summaryrefslogtreecommitdiff
path: root/exercises/hashmaps
diff options
context:
space:
mode:
authorliv <mokou@fastmail.com>2023-06-12 12:39:02 +0200
committerGitHub <noreply@github.com>2023-06-12 12:39:02 +0200
commitb44472b2372ef29f6c7053d0f8e87479fd02c52d (patch)
tree3f549ec5f5b85cd5c8cc6bf530a42bdde379644b /exercises/hashmaps
parent7eef5d15eef780f93e22b1b4e0185f7708219ea0 (diff)
parent4cfcf2ccd783fe3b7b28a3cae878d56ae3334b69 (diff)
Merge branch 'main' into comment_cleanup
Diffstat (limited to 'exercises/hashmaps')
-rw-r--r--exercises/hashmaps/hashmaps2.rs9
-rw-r--r--exercises/hashmaps/hashmaps3.rs3
2 files changed, 10 insertions, 2 deletions
diff --git a/exercises/hashmaps/hashmaps2.rs b/exercises/hashmaps/hashmaps2.rs
index f913848..a592569 100644
--- a/exercises/hashmaps/hashmaps2.rs
+++ b/exercises/hashmaps/hashmaps2.rs
@@ -81,4 +81,13 @@ mod tests {
let count = basket.values().sum::<u32>();
assert!(count > 11);
}
+
+ #[test]
+ fn all_fruit_types_in_basket() {
+ let mut basket = get_fruit_basket();
+ fruit_basket(&mut basket);
+ for amount in basket.values() {
+ assert_ne!(amount, &0);
+ }
+ }
}
diff --git a/exercises/hashmaps/hashmaps3.rs b/exercises/hashmaps/hashmaps3.rs
index 4b48e09..08e977c 100644
--- a/exercises/hashmaps/hashmaps3.rs
+++ b/exercises/hashmaps/hashmaps3.rs
@@ -18,9 +18,8 @@
use std::collections::HashMap;
-// A structure to store team name and its goal details.
+// A structure to store the goal details of a team.
struct Team {
- name: String,
goals_scored: u8,
goals_conceded: u8,
}