Skip to content

Instantly share code, notes, and snippets.

@swuecho
Forked from anonymous/playground.rs
Created July 3, 2015 23:58
Show Gist options
  • Save swuecho/ddfe1d085e498cab5244 to your computer and use it in GitHub Desktop.
Save swuecho/ddfe1d085e498cab5244 to your computer and use it in GitHub Desktop.
fn main() {
let player_scores = [
("Jack", 20), ("Jane", 23), ("Jill", 18), ("John", 19),
];
let players = player_scores
.iter()
.map(|&(player, _score)| {
player
})
.collect::<Vec<_>>();
assert_eq!(players, ["Jack", "Jane", "Jill", "John"]);
}
@swuecho
Copy link
Author

swuecho commented Jul 3, 2015

&(,)

vs

(,)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment