Merge pull request #762 from tlyu/move-semantics5-fixes

fix: move_semantics5 hints
This commit is contained in:
marisa 2021-05-23 15:41:56 +02:00 committed by GitHub
commit a2f0401c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,6 @@
// move_semantics5.rs // move_semantics5.rs
// Make me compile without adding any newlines or removing any of the lines. // Make me compile without adding, removing, or changing any of the
// lines in `main()`.
// Execute `rustlings hint move_semantics5` for hints :) // Execute `rustlings hint move_semantics5` for hints :)
// I AM NOT DONE // I AM NOT DONE

View File

@ -216,10 +216,14 @@ path = "exercises/move_semantics/move_semantics5.rs"
mode = "compile" mode = "compile"
hint = """ hint = """
Carefully reason about the range in which each mutable reference is in Carefully reason about the range in which each mutable reference is in
vogue. Does updating the value of referrent (x) immediately after the vogue. Does it help to update the value of referent (x) immediately after
mutable reference is taken helps? Read more about 'Mutable Referenes' the mutable reference is taken? Read more about 'Mutable References'
in the book's section References and Borrowing': in the book's section References and Borrowing':
https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references.""" https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references.
Additional hint:
If you can't add, change, or remove any statements in `main()`, can you
reorder them in a way that lets the program compile?"""
# PRIMITIVE TYPES # PRIMITIVE TYPES