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.
d75759e829
Instead of having to explain why ```rs let mut x = 100; let y = &mut x; let mut z_owned = *y; let z = &mut z_owned; *y += 100; *z += 1000; ``` and ```rs let mut x = 100; let y = &mut x; let z = &mut *y; *y += 100; *z += 1000; ``` are different, you still get the point across about having only one mutable reference. As it stands, this exercise does too much (dereferencing and having only one mutable reference), and by doing so confuses people. Example of someone being confused by this: <https://discord.com/channels/273534239310479360/273541522815713281/872689531428692040> |
3 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago | |
move_semantics1.rs | ||
move_semantics2.rs | ||
move_semantics3.rs | ||
move_semantics4.rs | 4 years ago | |
move_semantics5.rs | 3 years ago |
README.md
Move Semantics
These exercises are adapted from pnkfelix's Rust Tutorial -- Thank you Felix!!!
Further information
For this section, the book links are especially important.