Skip to content

Commit

Permalink
Merge pull request #2649 from Kixunil/patch-1
Browse files Browse the repository at this point in the history
Added an example of slicing result
  • Loading branch information
carols10cents committed Mar 19, 2021
2 parents bf33eb6 + ca34e59 commit 925c7ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ch04-03-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ to part of an array. We’d do so like this:
let a = [1, 2, 3, 4, 5];

let slice = &a[1..3];

assert_eq!(slice, &[2, 3]);
```

This slice has the type `&[i32]`. It works the same way as string slices do, by
Expand Down

0 comments on commit 925c7ea

Please sign in to comment.