rust-lang / rust-lang/book

ch04-02: Meaning is opposite

Open
#3,183 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
18.3k
Forks
4.1k
Avg merge
14m
Merged PRs (30d)
1

Description

  • I have checked the latest main branch to see if this has already been fixed
  • I have searched existing issues and pull requests for duplicates

URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html

Description of the problem:
The meaning is opposite

Suggested fix:
The issue with the tuple code in Listing 4-5 is that we have to return the String to the calling function so we [can > can't] still use the String after the call to calculate_length, because the String was moved into calculate_length.

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 linked ch04-02 section and locate Listing 4-5 and its surrounding explanation. Check the sentence about returning the String after calculate_length, update the wording to match the described move, and verify the rendered section reads correctly.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.