From: Martin Pitt Date: Thu, 26 Aug 2021 15:23:55 +0000 (+0200) Subject: Consistently use into_iter() with collect() X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=d65f952f600ad2d0828fd650829f6560404dca1c;p=learn-rust.git Consistently use into_iter() with collect() --- 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);