From 6f05a055c178abd3d77f6cd8fdd3e949555c7715 Mon Sep 17 00:00:00 2001 From: Pedro Morais Date: Fri, 16 Feb 2024 16:12:27 +0000 Subject: [PATCH] if exercises completed --- exercises/03_if/if1.rs | 10 +++++----- exercises/03_if/if2.rs | 7 ++++--- exercises/03_if/if3.rs | 5 ++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/exercises/03_if/if1.rs b/exercises/03_if/if1.rs index 4734d78..7404f67 100644 --- a/exercises/03_if/if1.rs +++ b/exercises/03_if/if1.rs @@ -2,13 +2,13 @@ // // 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 &str { if fizzish == "fizz" { "foo" - } else { - 1 + } else if fizzish == "fuzz"{ + "bar" + } else{ + "baz" } } diff --git a/exercises/03_if/if3.rs b/exercises/03_if/if3.rs index 1696274..80088f1 100644 --- a/exercises/03_if/if3.rs +++ b/exercises/03_if/if3.rs @@ -2,17 +2,16 @@ // // Execute `rustlings hint if3` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE pub fn animal_habitat(animal: &str) -> &'static str { let identifier = if animal == "crab" { 1 } else if animal == "gopher" { - 2.0 + 2 } else if animal == "snake" { 3 } else { - "Unknown" + 4 }; // DO NOT CHANGE THIS STATEMENT BELOW