mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-10 12:49:18 +00:00
functions4 modified
This commit is contained in:
parent
dba759e1c6
commit
2e8abe5a8f
@ -11,7 +11,7 @@ fn main() {
|
||||
println!("Your sale price is {}", sale_price(original_price));
|
||||
}
|
||||
|
||||
fn sale_price(price: i32) -> {
|
||||
fn sale_price(price: u32) -> u32 {
|
||||
if is_even(price) {
|
||||
price - 10
|
||||
} else {
|
||||
@ -19,6 +19,6 @@ fn sale_price(price: i32) -> {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_even(num: i32) -> bool {
|
||||
fn is_even(num: u32) -> bool {
|
||||
num % 2 == 0
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user