diff options
| author | mo8it <mo8it@proton.me> | 2024-04-17 22:46:21 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-17 22:46:21 +0200 |
| commit | cb9f1ac9ce3c834b0cca964b6809b74508f80b54 (patch) | |
| tree | f168d86b6035d7d9e357ac53cd36c2b8928f399b /exercises/11_hashmaps | |
| parent | d83cc69afecf59fba184755591d73c7208988574 (diff) | |
Require a main function in all exercises
Diffstat (limited to 'exercises/11_hashmaps')
| -rw-r--r-- | exercises/11_hashmaps/hashmaps1.rs | 4 | ||||
| -rw-r--r-- | exercises/11_hashmaps/hashmaps2.rs | 6 | ||||
| -rw-r--r-- | exercises/11_hashmaps/hashmaps3.rs | 10 |
3 files changed, 16 insertions, 4 deletions
diff --git a/exercises/11_hashmaps/hashmaps1.rs b/exercises/11_hashmaps/hashmaps1.rs index 5a52f61..51146df 100644 --- a/exercises/11_hashmaps/hashmaps1.rs +++ b/exercises/11_hashmaps/hashmaps1.rs @@ -24,6 +24,10 @@ fn fruit_basket() -> HashMap<String, u32> { basket } +fn main() { + // You can optionally experiment here. +} + #[cfg(test)] mod tests { use super::*; diff --git a/exercises/11_hashmaps/hashmaps2.rs b/exercises/11_hashmaps/hashmaps2.rs index 2730643..47983f6 100644 --- a/exercises/11_hashmaps/hashmaps2.rs +++ b/exercises/11_hashmaps/hashmaps2.rs @@ -41,6 +41,10 @@ fn fruit_basket(basket: &mut HashMap<Fruit, u32>) { } } +fn main() { + // You can optionally experiment here. +} + #[cfg(test)] mod tests { use super::*; @@ -79,7 +83,7 @@ mod tests { let count = basket.values().sum::<u32>(); assert!(count > 11); } - + #[test] fn all_fruit_types_in_basket() { let mut basket = get_fruit_basket(); diff --git a/exercises/11_hashmaps/hashmaps3.rs b/exercises/11_hashmaps/hashmaps3.rs index 775a401..3322909 100644 --- a/exercises/11_hashmaps/hashmaps3.rs +++ b/exercises/11_hashmaps/hashmaps3.rs @@ -5,9 +5,9 @@ // Example: England,France,4,2 (England scored 4 goals, France 2). // // You have to build a scores table containing the name of the team, the total -// number of goals the team scored, and the total number of goals the team -// conceded. One approach to build the scores table is to use a Hashmap. -// The solution is partially written to use a Hashmap, +// number of goals the team scored, and the total number of goals the team +// conceded. One approach to build the scores table is to use a Hashmap. +// The solution is partially written to use a Hashmap, // complete it to pass the test. // // Make me pass the tests! @@ -42,6 +42,10 @@ fn build_scores_table(results: String) -> HashMap<String, Team> { scores } +fn main() { + // You can optionally experiment here. +} + #[cfg(test)] mod tests { use super::*; |
