projects
/
learn-rust.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b756cb9
)
Consistently use into_iter() with collect()
author
Martin Pitt
<martin@piware.de>
Thu, 26 Aug 2021 15:23:55 +0000
(17:23 +0200)
committer
Martin Pitt
<martin@piware.de>
Thu, 26 Aug 2021 15:23:55 +0000
(17:23 +0200)
src/main.rs
patch
|
blob
|
history
diff --git
a/src/main.rs
b/src/main.rs
index 0ef1b16f4f9b19c7e9e1c71377abd4273acc0d1b..3b45c882984a49f2d4303543fba86b80b0f38b53 100644
(file)
--- 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.i
nto_i
ter()
.map(|(k, v)| (k, 2 * v))
.collect();
println!("collect_scores after rebuilding with doubling: {:?}", collect_scores);