Merge pull request #1 from laysakura/feature/variables
Feature/variables
This commit is contained in:
commit
11d1b58d64
|
@ -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