Merge 88086d6b9c
into b5bbd7247a
This commit is contained in:
commit
b842030887
|
@ -4,7 +4,9 @@ fn main() {
|
|||
call_me();
|
||||
}
|
||||
|
||||
|
||||
fn call_me() {
|
||||
println!("thank you for calling me :)");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ fn main() {
|
|||
call_me(3);
|
||||
}
|
||||
|
||||
fn call_me(num) {
|
||||
fn call_me(num: i32) {
|
||||
for i in 0..num {
|
||||
println!("Ring! Call number {}", i + 1);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
call_me();
|
||||
call_me(5);
|
||||
}
|
||||
|
||||
fn call_me(num: i32) {
|
||||
|
|
|
@ -8,7 +8,7 @@ fn main() {
|
|||
println!("Your sale price is {}", sale_price(original_price));
|
||||
}
|
||||
|
||||
fn sale_price(price: i32) -> {
|
||||
fn sale_price(price: i32) -> i32 {
|
||||
if is_even(price) {
|
||||
price - 10
|
||||
} else {
|
||||
|
|
|
@ -6,7 +6,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn square(num: i32) -> i32 {
|
||||
num * num;
|
||||
num * num
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
x = 5;
|
||||
let x = 5;
|
||||
println!("x has the value {}", x);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
let x;
|
||||
let x = 10;
|
||||
if x == 10 {
|
||||
println!("Ten!");
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
let x = 3;
|
||||
let mut x = 3;
|
||||
println!("Number {}", x);
|
||||
x = 5;
|
||||
println!("Number {}", x);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
let x: i32;
|
||||
let x: i32 = 777;
|
||||
println!("Number {}", x);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue