This commit is contained in:
Simon Halimi 2021-04-13 14:42:04 +02:00
parent ec46687742
commit b4635dcacd
2 changed files with 8 additions and 5 deletions
exercises/if

View file

@ -1,8 +1,11 @@
// if1.rs
pub fn bigger(a: i32, b: i32) -> i32 {
if1
return b;
if a > b {
a
} else {
b
}
}
// Don't mind this for now :)

View file

@ -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"
}
}