Mention or explain binding modes when describing patterns
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
mainbranch 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/nightly/book/ch06-00-enums.html
https://doc.rust-lang.org/nightly/book/ch18-00-patterns.html
https://doc.rust-lang.org/stable/book/ch15-06-reference-cycles.html#creating-a-reference-cycle
Description of the problem:
There's no mention in chapters 6 or 18 of how matching on a reference works when there's no reference operator in the pattern (i.e. binding modes / match ergonomics). In chapter 15, there is an example that implicitly uses this behaviour, but it is not explained or given a name, meaning people who want to learn more can't easily research the topic.
Suggested fix:
Add a page or section in chapter 18, either describing the behaviour, or naming it and pointing to the rust reference page on binding modes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the chapter 18 patterns section and compare it with the chapter 6 enums material and the chapter 15 reference-cycle example linked in the issue. Add a section or page that explains or names binding modes/match ergonomics and links to the Rust Reference; done means readers can identify and research the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100