diff --git a/exercises/11_hashmaps/hashmaps2.rs b/exercises/11_hashmaps/hashmaps2.rs index e9f53fea..a2689bf3 100644 --- a/exercises/11_hashmaps/hashmaps2.rs +++ b/exercises/11_hashmaps/hashmaps2.rs @@ -46,7 +46,7 @@ mod tests { // Don't modify this function! fn get_fruit_basket() -> HashMap { let content = [(Fruit::Apple, 4), (Fruit::Mango, 2), (Fruit::Lychee, 5)]; - HashMap::from_iter(content) + HashMap::from(content) } #[test] @@ -89,7 +89,7 @@ mod tests { for fruit_kind in fruit_kinds { let Some(amount) = basket.get(&fruit_kind) else { - panic!("Fruit kind {fruit_kind:?} was not found in basket"); + panic!("Fruit kind {:?} was not found in basket", fruit_kind); }; assert!(*amount > 0); } diff --git a/solutions/11_hashmaps/hashmaps2.rs b/solutions/11_hashmaps/hashmaps2.rs index 75e6ec2c..4a56fc84 100644 --- a/solutions/11_hashmaps/hashmaps2.rs +++ b/solutions/11_hashmaps/hashmaps2.rs @@ -45,7 +45,7 @@ mod tests { // Don't modify this function! fn get_fruit_basket() -> HashMap { let content = [(Fruit::Apple, 4), (Fruit::Mango, 2), (Fruit::Lychee, 5)]; - HashMap::from_iter(content) + HashMap::from(content) } #[test] @@ -88,7 +88,7 @@ mod tests { for fruit_kind in fruit_kinds { let Some(amount) = basket.get(&fruit_kind) else { - panic!("Fruit kind {fruit_kind:?} was not found in basket"); + panic!("Fruit kind {:?} was not found in basket", fruit_kind); }; assert!(*amount > 0); }