10: Add solutions for section "collections".

[?]
Aaw9nJhsNmfzFih9mKyNw9mV8CgERXJkRa1kK1Kx3LQH
Aug 6, 2021, 2:31 PM
45J42KQP7K3DMW2HZCQ53J7257MQ6V4AV2HOZLKYB5LFTBTARJHQC

Dependencies

Change contents

  • edit in exercises/collections/vec2.rs at line 9
    [2.159825][2.159825:159843]()
    // I AM NOT DONE
  • replacement in exercises/collections/vec2.rs at line 12
    [2.159915][2.159915:160012]()
    // TODO: Fill this up so that each element in the Vec `v` is
    // multiplied by 2.
    [2.159915]
    [2.160012]
    *i *= 2;
  • edit in exercises/collections/vec1.rs at line 6
    [2.160609][2.160609:160627]()
    // I AM NOT DONE
  • replacement in exercises/collections/vec1.rs at line 9
    [2.160720][2.160720:160793]()
    let v = // TODO: declare your vector here with the macro for vectors
    [2.160720]
    [2.160793]
    let v = a.to_vec(); // TODO: declare your vector here with the macro for vectors
  • edit in exercises/collections/hashmap2.rs at line 14
    [2.161532][2.161532:161550]()
    // I AM NOT DONE
  • edit in exercises/collections/hashmap2.rs at line 39
    [2.162083]
    [2.162083]
    if !basket.contains_key(&fruit) {
    basket.insert(fruit, 11);
    }
  • edit in exercises/collections/hashmap1.rs at line 13
    [2.163688][2.163688:163706]()
    // I AM NOT DONE
  • replacement in exercises/collections/hashmap1.rs at line 17
    [2.163783][2.163783:163841]()
    let mut basket = // TODO: declare your hash map here.
    [2.163783]
    [2.163841]
    let mut basket: HashMap<String, u32> = [(String::from("apple"), 1), (String::from("orange"), 2)]
    .iter().cloned().collect(); // TODO: declare your hash map here.