Compare commits

...

4 commits

Author SHA1 Message Date
markharley12 67b52a7ff6
Merge 2be69b0f8b into 26cf4989a2 2024-12-14 08:16:08 +09:00
Mo 26cf4989a2
Merge pull request #2173 from JoelMarcey/if2-comment-fix
Fix argument comment in test of if2.rs
2024-12-13 19:48:16 +01:00
Joel Marcey 6e60f441e9
Fix argument comment in test of if2.rs 2024-12-13 10:44:21 -08:00
markharley12 2be69b0f8b fix for a couple of small issues I came accross whilst doing the exercise 2024-11-15 20:44:38 +00:00
3 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@ mod tests {
#[test] #[test]
fn yummy_food() { fn yummy_food() {
// This means that calling `picky_eater` with the argument "food" should return "Yummy!". // This means that calling `picky_eater` with the argument "strawberry" should return "Yummy!".
assert_eq!(picky_eater("strawberry"), "Yummy!"); assert_eq!(picky_eater("strawberry"), "Yummy!");
} }

View file

@ -46,7 +46,7 @@ mod tests {
// Don't modify this function! // Don't modify this function!
fn get_fruit_basket() -> HashMap<Fruit, u32> { fn get_fruit_basket() -> HashMap<Fruit, u32> {
let content = [(Fruit::Apple, 4), (Fruit::Mango, 2), (Fruit::Lychee, 5)]; let content = [(Fruit::Apple, 4), (Fruit::Mango, 2), (Fruit::Lychee, 5)];
HashMap::from_iter(content) HashMap::from(content)
} }
#[test] #[test]
@ -89,7 +89,7 @@ mod tests {
for fruit_kind in fruit_kinds { for fruit_kind in fruit_kinds {
let Some(amount) = basket.get(&fruit_kind) else { 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); assert!(*amount > 0);
} }

View file

@ -45,7 +45,7 @@ mod tests {
// Don't modify this function! // Don't modify this function!
fn get_fruit_basket() -> HashMap<Fruit, u32> { fn get_fruit_basket() -> HashMap<Fruit, u32> {
let content = [(Fruit::Apple, 4), (Fruit::Mango, 2), (Fruit::Lychee, 5)]; let content = [(Fruit::Apple, 4), (Fruit::Mango, 2), (Fruit::Lychee, 5)];
HashMap::from_iter(content) HashMap::from(content)
} }
#[test] #[test]
@ -88,7 +88,7 @@ mod tests {
for fruit_kind in fruit_kinds { for fruit_kind in fruit_kinds {
let Some(amount) = basket.get(&fruit_kind) else { 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); assert!(*amount > 0);
} }