diff options
| author | olivia <olivia@fastmail.com> | 2018-04-26 21:29:11 +0200 |
|---|---|---|
| committer | olivia <olivia@fastmail.com> | 2018-04-26 21:29:11 +0200 |
| commit | 5e89d1e888a8fafc39096afce36d02e313f349c2 (patch) | |
| tree | 97b13f8223012d1db88d510cd79ea0e49570d1f7 /old_curriculum/variables/variables3.rs | |
| parent | 32ac403da5c49b002ba420186d3122501196ff89 (diff) | |
move old files to a separate directory
Diffstat (limited to 'old_curriculum/variables/variables3.rs')
| -rw-r--r-- | old_curriculum/variables/variables3.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/old_curriculum/variables/variables3.rs b/old_curriculum/variables/variables3.rs new file mode 100644 index 0000000..165a277 --- /dev/null +++ b/old_curriculum/variables/variables3.rs @@ -0,0 +1,43 @@ +// variables3.rs +// Make me compile! Scroll down for hints :) + +fn main() { + let x = 3; + println!("Number {}", x); + 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. |
