Skip to content

Commit 925c7ea

Browse files
Merge pull request rust-lang#2649 from Kixunil/patch-1
Added an example of slicing result
2 parents bf33eb6 + ca34e59 commit 925c7ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ch04-03-slices.md

+2
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ to part of an array. We’d do so like this:
281281
let a = [1, 2, 3, 4, 5];
282282

283283
let slice = &a[1..3];
284+
285+
assert_eq!(slice, &[2, 3]);
284286
```
285287

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

0 commit comments

Comments
 (0)