book icon indicating copy to clipboard operation
book copied to clipboard

Mention or explain binding modes when describing patterns

Open Zoybean opened this issue 3 years ago • 0 comments

  • [x] I have checked the latest main branch to see if this has already been fixed
  • [x] 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.

Zoybean avatar Aug 31 '22 05:08 Zoybean