mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 13:19:18 +00:00
control flpw
This commit is contained in:
parent
25673f002f
commit
bad3f7c461
@ -1,7 +1,7 @@
|
||||
// functions5.rs
|
||||
// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
|
||||
fn main() {
|
||||
let answer = square(3);
|
||||
|
||||
@ -1,13 +1,18 @@
|
||||
// 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 :)
|
||||
|
||||
@ -9,8 +9,10 @@
|
||||
pub fn foo_if_fizz(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