Skip to content

fix: relocate paragraph, rename variable #311

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iampi31415
Copy link

@iampi31415 iampi31415 commented Jun 9, 2025

There are two changes here:

  1. Rename n_ref to i because that's what the code shows. I do get that n_ref was more pedagogical. But currently is just confusing.
  2. There is a paragraph explaining that we read the value with *i which confuses readers where it is located. So I moved it just to the next listing, where it is actually used.

Note that no paragraph was deleted, it's just relocated (the diff may be confusing).

I've tried other solutions like removing it entirely or rephrasing it, but this seems to me to involve the least changes and be most fit.

cc: @willcrichton

closes #310

There are two changes here:

1. Rename `n_ref` to `i` because that's what the code shows. You can find source for the two related listings [08-07](https://github.com/cognitive-engineering-lab/rust-book/blob/main/listings/ch08-common-collections/listing-08-07/src/main.rs), and [08-08](https://github.com/cognitive-engineering-lab/rust-book/blob/main/listings/ch08-common-collections/listing-08-08/src/main.rs)
2. There is a paragraph explaining that we read the value with `*i` which confuses readers where it is located. So I moved it just to the next listing, where it is _actually_ used.

I've tried other solutions like removing it entirely or rephrasing it, but this seems to me to involve the least changes and be most fit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misplaced paragraph in Chapter 8.1
1 participant