]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #21013: steveklabnik/gh20914
authorAlex Crichton <alex@alexcrichton.com>
Thu, 15 Jan 2015 22:11:33 +0000 (14:11 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 15 Jan 2015 22:11:33 +0000 (14:11 -0800)
Fixes #20914

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

index 7f8bdfe6972c0ba2ea6a32753dcde76af3ee3827..e7ac55bfbd30d4ccb26792f059054f8a4f1d0a2f 100644 (file)
@@ -82,7 +82,7 @@ arrays:
 
 ```{rust}
 let a = [0, 1, 2, 3, 4];
-let middle = a.slice(1, 4);     // A slice of a: just the elements [1,2,3]
+let middle = &a[1..4];     // A slice of a: just the elements 1, 2, and 3
 
 for e in middle.iter() {
     println!("{}", e);          // Prints 1, 2, 3