Skip to content

Commit 5cf4139

Browse files
committed
fix tests
1 parent a673ced commit 5cf4139

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/book/slice-patterns.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
let v = vec!["match_this", "1"];
1111

1212
match &v[..] {
13-
["match_this", second] => println!("The second element is {}", second),
13+
&["match_this", second] => println!("The second element is {}", second),
1414
_ => {},
1515
}
1616
}
@@ -26,8 +26,8 @@ slice will be bound to that name. For example:
2626

2727
fn is_symmetric(list: &[u32]) -> bool {
2828
match list {
29-
[] | [_] => true,
30-
[x, inside.., y] if x == y => is_symmetric(inside),
29+
&[] | &[_] => true,
30+
&[x, ref inside.., y] if x == y => is_symmetric(inside),
3131
_ => false
3232
}
3333
}

0 commit comments

Comments
 (0)