This commit is contained in:
Jasper Ras 2026-01-15 09:09:24 +01:00
parent eb9773627e
commit 10b29ad9cb
14 changed files with 164 additions and 0 deletions

13
ch8/ch10/update_old.rs Normal file
View file

@ -0,0 +1,13 @@
use std::collections::HashMap;
fn main() {
let text = "hello world wonderful world";
let mut map = HashMap::new();
for word in text.split_whitespace() {
let count = map.entry(word).or_insert(0);
*count += 1;
}
println!("{map:?}");
}