mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-07 03:09:19 +00:00
if done
This commit is contained in:
parent
ec46687742
commit
b4635dcacd
@ -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 :)
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user