diff --git a/exercises/if/if1.rs b/exercises/if/if1.rs index d8108a0f..d7d21319 100644 --- a/exercises/if/if1.rs +++ b/exercises/if/if1.rs @@ -2,13 +2,16 @@ // // 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 { // Complete this function to return the bigger number! // Do not use: // - another function call // - additional variables + if (a < b) { + b + } else { + a + } } // Don't mind this for now :) diff --git a/exercises/if/if2.rs b/exercises/if/if2.rs index f512f13f..9ae278f2 100644 --- a/exercises/if/if2.rs +++ b/exercises/if/if2.rs @@ -5,13 +5,13 @@ // // 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" } }