mirror of https://github.com/rust-lang/rustlings
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
387 B
Rust
44 lines
387 B
Rust
7 years ago
|
// variables3.rs
|
||
9 years ago
|
// Make me compile! Scroll down for hints :)
|
||
9 years ago
|
|
||
|
fn main() {
|
||
|
let x = 3;
|
||
|
println!("Number {}", x);
|
||
|
x = 5;
|
||
|
println!("Number {}", x);
|
||
|
}
|
||
9 years ago
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// In Rust, variable bindings are immutable by default. But here we're trying
|
||
|
// to reassign a different value to x! There's a keyword we can use to make
|
||
|
// a variable binding mutable instead.
|