Skip to content

Commit c6a9877

Browse files
committed
rollup merge of #21013: steveklabnik/gh20914
Fixes #20914
2 parents 73660a1 + c403794 commit c6a9877

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ arrays:
8282

8383
```{rust}
8484
let a = [0, 1, 2, 3, 4];
85-
let middle = a.slice(1, 4); // A slice of a: just the elements [1,2,3]
85+
let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3
8686
8787
for e in middle.iter() {
8888
println!("{}", e); // Prints 1, 2, 3

0 commit comments

Comments
 (0)