Created
November 26, 2014 08:20
-
-
Save scode/7aa897c4c174b008303a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for line_or_fail in io::stdin().lines() { | |
| let entry = line_counts.entry(line_or_fail.unwrap()); | |
| match entry { | |
| Occupied(mut entry) => { *entry.get_mut() = *entry.get_mut() + 1; }, | |
| Vacant(entry) => { entry.set(1); }, | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment