From 5812f1f27b0e3c2eed6e4606635bb810d0a5727e Mon Sep 17 00:00:00 2001 From: Adam Sherwood Date: Sun, 20 Feb 2022 16:15:56 +0100 Subject: [PATCH] fix(if2): Rename if2 exercise function to foo_if_fizz. The reasoning here is pretty straightforward: you don't say "Hungry, if eat." That doesn't make sense. We want to get "foo" back if given "fizz", so it seems this makes far more sense as "Eat, if hungry," or in this case, return `foo_if_fizz` is given. --- exercises/if/if2.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/if/if2.rs b/exercises/if/if2.rs index 6fed6f8..effddbb 100644 --- a/exercises/if/if2.rs +++ b/exercises/if/if2.rs @@ -6,7 +6,7 @@ // I AM NOT DONE -pub fn fizz_if_foo(fizzish: &str) -> &str { +pub fn foo_if_fizz(fizzish: &str) -> &str { if fizzish == "fizz" { "foo" } else { @@ -21,16 +21,16 @@ mod tests { #[test] fn foo_for_fizz() { - assert_eq!(fizz_if_foo("fizz"), "foo") + assert_eq!(foo_if_fizz("fizz"), "foo") } #[test] fn bar_for_fuzz() { - assert_eq!(fizz_if_foo("fuzz"), "bar") + assert_eq!(foo_if_fizz("fuzz"), "bar") } #[test] fn default_to_baz() { - assert_eq!(fizz_if_foo("literally anything"), "baz") + assert_eq!(foo_if_fizz("literally anything"), "baz") } }