fix doc example

master
Avril 4 years ago
parent 1be0750563
commit d26e324b14
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -12,10 +12,10 @@ fn max_char(chars: &str) -> (char, usize)
{ {
let mut map = Map::new(); let mut map = Map::new();
for x in chars.chars() { for x in chars.chars() {
*map.entry(x).or_insert(0usize) += 1; *map.entry(x).or_insert(0usize) += 1;
} }
map.into_iter().max_by_key(|(k, v)| v).unwrap_or_default() map.into_iter().max_by_key(|&(_, v)| v).unwrap_or_default()
} }
``` ```

Loading…
Cancel
Save