Skip to content

Instantly share code, notes, and snippets.

@jtdowney
Created May 31, 2016 14:47
Show Gist options
  • Save jtdowney/e695dbc8a659b037b67a3cbd2dd912a7 to your computer and use it in GitHub Desktop.
Save jtdowney/e695dbc8a659b037b67a3cbd2dd912a7 to your computer and use it in GitHub Desktop.
#![feature(slice_patterns)]
fn main() {
let foo: Vec<i32> = (1..10).collect();
match foo.as_slice() {
[first, rest..] => println!("{:?} :: {:?}", first, rest),
[] => println!("empty"),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment