added(): test commit

This commit is contained in:
Tomasz Waszczyk 2022-06-14 18:25:33 +02:00
parent ed18c3b93d
commit b59f38da23
No known key found for this signature in database
GPG Key ID: 2D1E70DB13336E3A
2 changed files with 10 additions and 3 deletions

View File

@ -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 if fizzish == "fuzz" {
"bar"
} else {
1
"baz"
}
}

View File

@ -11,7 +11,13 @@
// I AM NOT DONE
// Put your function here!
// fn calculate_apple_price {
fn calculate_apple_price(quantity: i32) -> i32 {
if quantity > 40 {
return quantity;
} else {
return quantity * 2;
}
}
// Don't modify this function!
#[test]