X-Git-Url: https://piware.de/gitweb/?p=learn-rust.git;a=blobdiff_plain;f=src%2Fmain.rs;fp=src%2Fmain.rs;h=3b45c882984a49f2d4303543fba86b80b0f38b53;hp=0ef1b16f4f9b19c7e9e1c71377abd4273acc0d1b;hb=d65f952f600ad2d0828fd650829f6560404dca1c;hpb=b756cb948f64416c2f5fd280a971bc7daa3bddea diff --git a/src/main.rs b/src/main.rs index 0ef1b16..3b45c88 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ fn test_hashmaps() { println!("scores after doubling: {:?}", scores); // double scores of immutable hashmap (rebuild it) - let collect_scores: HashMap<_, _> = collect_scores.iter() + let collect_scores: HashMap<_, _> = collect_scores.into_iter() .map(|(k, v)| (k, 2 * v)) .collect(); println!("collect_scores after rebuilding with doubling: {:?}", collect_scores);