mirror of
https://github.com/notohh/rustlings.git
synced 2024-12-26 12:18:08 -05:00
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> |
||
---|---|---|
.. | ||
clippy | ||
collections | ||
conversions | ||
enums | ||
error_handling | ||
functions | ||
generics | ||
if | ||
macros | ||
modules | ||
move_semantics | ||
option | ||
primitive_types | ||
standard_library_types | ||
strings | ||
structs | ||
tests | ||
threads | ||
traits | ||
variables | ||
quiz1.rs | ||
quiz2.rs | ||
quiz3.rs | ||
quiz4.rs | ||
README.md |
Exercise to Book Chapter mapping
Exercise | Book Chapter |
---|---|
variables | §3.1 |
functions | §3.3 |
if | §3.5 |
move_semantics | §4.1 |
primitive_types | §4.3 |
structs | §5.1 |
enums | §6 |
modules | §7 |
collections | §8.1, §8.3 |
strings | §8.2 |
error_handling | §9 |
generics | §10 |
option | §10.1 |
traits | §10.2 |
tests | §11.1 |
standard_library_types | §13.2 |
threads | §16.1 |
macros | §19.6 |
clippy | n/a |
conversions | n/a |