From 4cf862c51d1f652d05dfd791c60963602c525d07 Mon Sep 17 00:00:00 2001 From: Stirling Hostetter Date: Wed, 2 Nov 2022 11:56:56 -0500 Subject: [PATCH 1/2] complete if1 --- exercises/if/if1.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/if/if1.rs b/exercises/if/if1.rs index 587e03f8..5e135f51 100644 --- a/exercises/if/if1.rs +++ b/exercises/if/if1.rs @@ -1,9 +1,8 @@ // if1.rs // Execute `rustlings hint if1` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE - pub fn bigger(a: i32, b: i32) -> i32 { + return if a > b { a } else { b }; // Complete this function to return the bigger number! // Do not use: // - another function call From 96d799cde0b24e85bf58a4fbf9f29d9adeb8d5aa Mon Sep 17 00:00:00 2001 From: Stirling Hostetter Date: Wed, 2 Nov 2022 12:02:38 -0500 Subject: [PATCH 2/2] complete if2 --- exercises/if/if2.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/if/if2.rs b/exercises/if/if2.rs index effddbb6..5facfc62 100644 --- a/exercises/if/if2.rs +++ b/exercises/if/if2.rs @@ -4,13 +4,13 @@ // Step 2: Get the bar_for_fuzz and default_to_baz tests passing! // Execute `rustlings hint if2` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE - pub fn foo_if_fizz(fizzish: &str) -> &str { if fizzish == "fizz" { "foo" + } else if fizzish == "fuzz"{ + "bar" } else { - 1 + "baz" } }