diff options
| author | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2015-09-17 19:16:30 -0400 |
|---|---|---|
| committer | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2015-09-17 19:16:30 -0400 |
| commit | dbfab88e610746118b8a0c26340fb677b70e9e75 (patch) | |
| tree | 516e7941aacc5ccfb14813d79ed4ca0da9ee9662 /variables/variables3.rs | |
| parent | 9cf4958982fb1dedb24c5f63c52f2ab30e77e362 (diff) | |
Add hints to the variable bindings exercises
Diffstat (limited to 'variables/variables3.rs')
| -rw-r--r-- | variables/variables3.rs | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/variables/variables3.rs b/variables/variables3.rs index cadb40b..ec55a95 100644 --- a/variables/variables3.rs +++ b/variables/variables3.rs @@ -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. |
