about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/book/slice-patterns.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/book/slice-patterns.md b/src/doc/book/slice-patterns.md
index de165b70fc4..fcedf0c994f 100644
--- a/src/doc/book/slice-patterns.md
+++ b/src/doc/book/slice-patterns.md
@@ -10,7 +10,7 @@ fn main() {
     let v = vec!["match_this", "1"];
 
     match &v[..] {
-        ["match_this", second] => println!("The second element is {}", second),
+        &["match_this", second] => println!("The second element is {}", second),
         _ => {},
     }
 }
@@ -26,8 +26,8 @@ slice will be bound to that name. For example:
 
 fn is_symmetric(list: &[u32]) -> bool {
     match list {
-        [] | [_] => true,
-        [x, inside.., y] if x == y => is_symmetric(inside),
+        &[] | &[_] => true,
+        &[x, ref inside.., y] if x == y => is_symmetric(inside),
         _ => false
     }
 }