From 95914416dde855b63af4fb47e0fe77e1546a3770 Mon Sep 17 00:00:00 2001 From: Daniil Moiseev Date: Wed, 21 Sep 2022 21:02:29 +0000 Subject: [PATCH] if --- exercises/if/if1.rs | 7 +++++-- exercises/if/if2.rs | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) 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" } }