From 88b467c8f908dc182b51030c593ca4e923fe23aa Mon Sep 17 00:00:00 2001 From: Aizon Date: Wed, 28 Jun 2023 10:04:06 +0100 Subject: [PATCH 1/2] Added necessary "at" in line 170 I had to read this line more than 4 times to understand it. Having the "at" makes it more readable --- src/ch04-02-references-and-borrowing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch04-02-references-and-borrowing.md b/src/ch04-02-references-and-borrowing.md index ea2d8d2029..bffbae1243 100644 --- a/src/ch04-02-references-and-borrowing.md +++ b/src/ch04-02-references-and-borrowing.md @@ -167,7 +167,7 @@ reading of the data. Note that a reference’s scope starts from where it is introduced and continues through the last time that reference is used. For instance, this code will -compile because the last usage of the immutable references, the `println!`, +compile because at the last usage of the immutable references, the `println!`, occurs before the mutable reference is introduced: ```rust,edition2021 From 53bc0576282c6709037c6d97d0dcbd59755a4a70 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Thu, 12 Dec 2024 09:38:22 -0700 Subject: [PATCH 2/2] Ch. 4: further clarify paragraph about reference scope --- src/ch04-02-references-and-borrowing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch04-02-references-and-borrowing.md b/src/ch04-02-references-and-borrowing.md index bffbae1243..2d35b5564f 100644 --- a/src/ch04-02-references-and-borrowing.md +++ b/src/ch04-02-references-and-borrowing.md @@ -167,8 +167,8 @@ reading of the data. Note that a reference’s scope starts from where it is introduced and continues through the last time that reference is used. For instance, this code will -compile because at the last usage of the immutable references, the `println!`, -occurs before the mutable reference is introduced: +compile because the last usage of the immutable references is in the `println!`, +before the mutable reference is introduced: ```rust,edition2021 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs:here}}