From cb6286419726256787490e6a02211459635ae7db Mon Sep 17 00:00:00 2001 From: asif256000 Date: Thu, 22 Dec 2022 13:00:48 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=F0=9F=A6=80=20If=20Solved?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 587e03f8..660a093c 100644 --- a/exercises/if/if1.rs +++ b/exercises/if/if1.rs @@ -1,13 +1,16 @@ // 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 { // Complete this function to return the bigger number! // Do not use: // - another function call // - additional variables + 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 effddbb6..129a4a25 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" } }