Skip to content

Commit d450982

Browse files
author
Ben Leadbetter
committed
docs: fix typos in readme
1 parent 367e944 commit d450982

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,10 @@ let buffer = [
207207
0x4441_5733,
208208
0x362D_3136,
209209
];
210-
let Ok(message) = UmpMessage::try_from(&buffer[..]) else {
211-
panic!();
212-
};
210+
let message = UmpMessage::try_from(&buffer[..]).expect("Valid data");
213211
```
214212

215-
Of course this means that such borrowed messages are imutable
213+
Of course this means that such borrowed messages are immutable
216214
and also have their lifetimes tied to the original buffer.
217215

218216
To remedy this messages can be `rebuffered` into a different
@@ -226,12 +224,12 @@ use midi2::{
226224

227225
let mut owned: NoteOn::<[u32; 4]> = {
228226
let buffer = [0x4898_5E03_u32, 0x6A14_E98A];
229-
// the borrowed message is imutable and cannot outlive `buffer`
227+
// the borrowed message is immutable and cannot outlive `buffer`
230228
let borrowed = NoteOn::try_from(&buffer[..]).expect("Data is valid");
231229
borrowed.try_rebuffer_into().expect("Buffer is large enough")
232230
};
233231

234-
// the owned message is mutable an liberated from the buffer lifetime.
232+
// the owned message is mutable and liberated from the buffer lifetime.
235233
owned.set_channel(u4::new(0x9));
236234
assert_eq!(owned.data(), &[0x4899_5E03, 0x6A14_E98A])
237235
```

0 commit comments

Comments
 (0)