Add hints to the variable bindings exercises

This commit is contained in:
Carol (Nichols || Goulding)
2015-09-17 19:16:30 -04:00
parent 9cf4958982
commit dbfab88e61
5 changed files with 151 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
// Make me compile!
// Make me compile! Scroll down for hints :)
fn main() {
let x = 3;
@@ -6,3 +6,37 @@ fn main() {
x = 5;
println!("Number {}", x);
}
// 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.