Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenthz committed Mar 15, 2023
1 parent 233dd2d commit f9e7c9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ For slice to array reference changes of the form:
fn function(value: &[u8]) { ... }
```

tto:
to:

```
fn function(value: &[u8; 12]) { ... }
```

In the case of the caller using array of the right size already,
no changes need to be done. When the caller is using a subslice,
no changes need to be done. But, when the caller is using a subslice,
one can use the following construction, from:

```
Expand All @@ -31,6 +31,7 @@ fn caller() {
let slice = &[....];
function(<&[u8; 12]>::try_from(&slice[0..12]).unwrap());
}
```

Note the .unwrap() is just one way to (not) handle the error, and the caller
should integrate the failing `try_from` case with the error handling
Expand Down

0 comments on commit f9e7c9a

Please sign in to comment.