From 4c46e5e1a33478d6cdb5f2a08b62f5ee79e35dd9 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Sat, 22 May 2021 21:56:14 -0500 Subject: [PATCH 1/2] chore: minor typos in move_semantics5 hints --- info.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info.toml b/info.toml index 0e9f428229..d8e7dd5963 100644 --- a/info.toml +++ b/info.toml @@ -216,8 +216,8 @@ path = "exercises/move_semantics/move_semantics5.rs" mode = "compile" hint = """ Carefully reason about the range in which each mutable reference is in -vogue. Does updating the value of referrent (x) immediately after the -mutable reference is taken helps? Read more about 'Mutable Referenes' +vogue. Does updating the value of referent (x) immediately after the +mutable reference is taken helps? Read more about 'Mutable References' in the book's section References and Borrowing': https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references.""" From 1b85828548f46f58b622b5e0c00f8c989f928807 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Sat, 22 May 2021 22:09:58 -0500 Subject: [PATCH 2/2] 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. --- exercises/move_semantics/move_semantics5.rs | 3 ++- info.toml | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/exercises/move_semantics/move_semantics5.rs b/exercises/move_semantics/move_semantics5.rs index 4f8128c775..2fb7b8e84c 100644 --- a/exercises/move_semantics/move_semantics5.rs +++ b/exercises/move_semantics/move_semantics5.rs @@ -1,5 +1,6 @@ // 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 :) // I AM NOT DONE diff --git a/info.toml b/info.toml index d8e7dd5963..8c8f7c182d 100644 --- a/info.toml +++ b/info.toml @@ -216,10 +216,14 @@ path = "exercises/move_semantics/move_semantics5.rs" mode = "compile" hint = """ Carefully reason about the range in which each mutable reference is in -vogue. Does updating the value of referent (x) immediately after the -mutable reference is taken helps? Read more about 'Mutable References' +vogue. Does it help to update the value of referent (x) immediately after +the mutable reference is taken? Read more about 'Mutable References' 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