mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-10 12:49:18 +00:00
if clear
This commit is contained in:
parent
c31c5c1fb2
commit
5155cf7547
@ -1,6 +1,5 @@
|
||||
// if1.rs
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
pub fn bigger(a: i32, b: i32) -> i32 {
|
||||
// Complete this function to return the bigger number!
|
||||
@ -8,6 +7,11 @@ pub fn bigger(a: i32, b: i32) -> i32 {
|
||||
// - another function call
|
||||
// - additional variables
|
||||
// Execute `rustlings hint if1` for hints
|
||||
if a>b{
|
||||
a
|
||||
}else {
|
||||
b
|
||||
}
|
||||
}
|
||||
|
||||
// Don't mind this for now :)
|
||||
|
||||
@ -4,13 +4,14 @@
|
||||
// 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 {
|
||||
1
|
||||
} else if fizzish=="fuzz"{
|
||||
"bar"
|
||||
}else {
|
||||
"baz"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user