Skip to content

Commit 1b85828

Browse files
committed
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.
1 parent 4c46e5e commit 1b85828

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

exercises/move_semantics/move_semantics5.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// move_semantics5.rs
2-
// Make me compile without adding any newlines or removing any of the lines.
2+
// Make me compile without adding, removing, or changing any of the
3+
// lines in `main()`.
34
// Execute `rustlings hint move_semantics5` for hints :)
45

56
// I AM NOT DONE

info.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,14 @@ path = "exercises/move_semantics/move_semantics5.rs"
216216
mode = "compile"
217217
hint = """
218218
Carefully reason about the range in which each mutable reference is in
219-
vogue. Does updating the value of referent (x) immediately after the
220-
mutable reference is taken helps? Read more about 'Mutable References'
219+
vogue. Does it help to update the value of referent (x) immediately after
220+
the mutable reference is taken? Read more about 'Mutable References'
221221
in the book's section References and Borrowing':
222-
https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references."""
222+
https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references.
223+
224+
Additional hint:
225+
If you can't add, change, or remove any statements in `main()`, can you
226+
reorder them in a way that lets the program compile?"""
223227

224228
# PRIMITIVE TYPES
225229

0 commit comments

Comments
 (0)