mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-09 20:29:18 +00:00
Complete very basic quiz.
This commit is contained in:
parent
625f4b6e12
commit
2f88671e19
@ -13,10 +13,17 @@
|
||||
//
|
||||
// No hints this time ;)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
// Put your function here!
|
||||
// fn calculate_price_of_apples {
|
||||
fn calculate_price_of_apples(quantity: i32) -> i32 {
|
||||
|
||||
if quantity > 40 {
|
||||
quantity
|
||||
} else {
|
||||
quantity * 2
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Don't modify this function!
|
||||
#[test]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user