fix tests

This commit is contained in:
Ariel Ben-Yehuda 2016-06-07 00:07:24 +03:00
parent a673cedf7b
commit 5cf4139d21

View File

@ -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
}
}