added an example for binding after @
@@ -384,6 +384,9 @@ match slice {
// `end` is a slice of everything but the first element, which must be "a".
["a", end @ ..] => println!("ends with: {:?}", end),
+ // 'whole' is the entire slice and `last` the the final element
+ whole @ [.., last] => println!("the last element of {:?} is {}", whole, last)
+
rest => println!("{:?}", rest),
}
