From df11d5b28a188af12d52c37b60c5ffd20dd89e89 Mon Sep 17 00:00:00 2001 From: NoneTheWisr <12655815+NoneTheWisr@users.noreply.github.com> Date: Fri, 28 Jan 2022 18:58:44 +0400 Subject: [PATCH] finish if (#3) --- exercises/if/if1.rs | 8 +------- exercises/if/if2.rs | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/exercises/if/if1.rs b/exercises/if/if1.rs index 90867545..a7dd4ad5 100644 --- a/exercises/if/if1.rs +++ b/exercises/if/if1.rs @@ -1,13 +1,7 @@ // if1.rs -// I AM NOT DONE - pub fn bigger(a: i32, b: i32) -> i32 { - // Complete this function to return the bigger number! - // Do not use: - // - another function call - // - additional variables - // Execute `rustlings hint if1` for hints + if a > b {a} else {b} } // Don't mind this for now :) diff --git a/exercises/if/if2.rs b/exercises/if/if2.rs index 80effbdf..545083a3 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 the command `rustlings hint if2` if you want a hint :) -// I AM NOT DONE - pub fn fizz_if_foo(fizzish: &str) -> &str { if fizzish == "fizz" { "foo" + } else if fizzish == "fuzz" { + "bar" } else { - 1 + "baz" } }