Commit Graph

6 Commits (30291a3c253f08a4191cfd544ba36867612ebb7a)

Author SHA1 Message Date
mokou 2e62505143 feat(move_semantics): finish updating comments 2 years ago
Fredrik Enestad 46c28d5cef
fix(move_semantics5): correct typo (#857) 3 years ago
frogtd d75759e829
fix(move_semantics5): change &mut *y to &mut x (#814)
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
ana df25684cb7 fix(move_semantics5): Clarify instructions 3 years ago
Taylor Yu 1b85828548 fix: move_semantics5 hints
Improve the hints for move_semantics5, as well as the explanatory
comments in the code.

Previously, it was not clear what possible changes were allowed.
It seems that reordering the statements might be the intended solution.
The previous comment about not "adding newlines" doesn't make sense,
so treating it as "adding new lines" makes it more clear.
3 years ago
Sateesh 399ab328d8
feat: Add move_semantics5 exercise. (#746)
* feat: Add move_semantics5 exercise.

* feat: Add option3 exercise

* Address review comments. Fix typos, sentence formatting.

* Remove unwanted newline.

* Address review comments: make comment inline, fix format in print.
3 years ago