From 5cf4139d21073731fa7f7226d941349dbacc16d6 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Tue, 7 Jun 2016 00:07:24 +0300 Subject: [PATCH] fix tests --- src/doc/book/slice-patterns.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/book/slice-patterns.md b/src/doc/book/slice-patterns.md index de165b70fc40..fcedf0c994f9 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 } }