10: Add solutions for section "collections".
[?]
Aaw9nJhsNmfzFih9mKyNw9mV8CgERXJkRa1kK1Kx3LQH
Aug 6, 2021, 2:31 PM
45J42KQP7K3DMW2HZCQ53J7257MQ6V4AV2HOZLKYB5LFTBTARJHQCDependencies
- [2]
H6XH45OP0
Change contents
- edit in exercises/collections/vec2.rs at line 9
// I AM NOT DONE - replacement in exercises/collections/vec2.rs at line 12
// TODO: Fill this up so that each element in the Vec `v` is// multiplied by 2.*i *= 2; - edit in exercises/collections/vec1.rs at line 6
// I AM NOT DONE - replacement in exercises/collections/vec1.rs at line 9
let v = // TODO: declare your vector here with the macro for vectorslet v = a.to_vec(); // TODO: declare your vector here with the macro for vectors - edit in exercises/collections/hashmap2.rs at line 14
// I AM NOT DONE - edit in exercises/collections/hashmap2.rs at line 39
if !basket.contains_key(&fruit) {basket.insert(fruit, 11);} - edit in exercises/collections/hashmap1.rs at line 13
// I AM NOT DONE - replacement in exercises/collections/hashmap1.rs at line 17
let mut basket = // TODO: declare your hash map here.let mut basket: HashMap<String, u32> = [(String::from("apple"), 1), (String::from("orange"), 2)].iter().cloned().collect(); // TODO: declare your hash map here.