Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch. 4: Rephrase/clarify paragraph on reference scope #3688

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

DreadedHippy
Copy link
Contributor

I had to read this line more than 4 times to understand it. Having the "at" makes it more readable

I had to read this line more than 4 times to understand it. Having the "at" makes it more readable
Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can definitely sympathize with that experience, so I am sorry you had it! Unfortunately, the change actually makes the sentence incorrect grammatically, and the original is correct grammatically. We might be able to tweak it so the sentence reads like this, though:

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, in the println!, occurs before the mutable reference is introduced:

That is still grammatically correct, preserving the structure of the sentence. Would it have helped with your confusion here?

@chriskrycho chriskrycho added this to the ch4 milestone Apr 3, 2024
@mon04
Copy link

mon04 commented Dec 11, 2024

@chriskrycho personally, I don't find that any better. But it is subjective.

How about:

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, namely the println!, occurs before the mutable reference is introduced:

@chriskrycho
Copy link
Contributor

I ended up going with a further variant which I think is much clearer:

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 is in the println!, before the mutable reference is introduced:

@chriskrycho chriskrycho changed the title Added necessary "at" in line 170 Ch. 4: Rephrase/clarify paragraph on reference scope Dec 12, 2024
@chriskrycho chriskrycho merged commit c9820ad into rust-lang:main Dec 12, 2024
3 checks passed
@DreadedHippy
Copy link
Contributor Author

I ended up going with a further variant which I think is much clearer:

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 is in the println!, before the mutable reference is introduced:

This makes it alot easier to understand. Thank you

@chriskrycho
Copy link
Contributor

You’re welcome! Thanks for flagging it up originally, and thanks @mon04 for the further feedback here as well. 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants