rust-lang / rust-lang/rust-by-example

incorrect comments in section "Structures"

Open
#1,866 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Handlebars
Stars
8.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I have searched open and closed issues and pull requests for duplicates, using these search terms:

  • "another_point"

URL to the section(s) of the book with this problem:

  • file:///Users/XXX/.rustup/toolchains/stable-aarch64-apple-darwin/share/doc/rust/html/rust-by-example/custom_types/structs.html

Description of the problem:
comment is not correct in Line 50, 51 for this block: Line 46-52, since bottom_right.y is updated by another_point.y, not point.y:

Screenshot 2024-07-22 at 9 44 32 AM

Suggested fix:
here the comment for println second point should be:
// bottom_right.y will be the same as another_point.y because we used that field
// from another_point

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the Structures section at custom_types/structs.html and inspect lines 46-52, especially the comments before the second println. Update those comments so they refer to bottom_right.y being taken from another_point.y, then verify the rendered example shows the corrected explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.