Skip to content

reference documentation does not explain "if let" and "while let" clearly #29801

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

Closed
froydnj opened this issue Nov 12, 2015 · 0 comments
Closed

Comments

@froydnj
Copy link
Contributor

froydnj commented Nov 12, 2015

When looking at the reference docs (stable and nightly), the sections on "if let expressions" and "while let expressions" both refer to "refutable let statements". I think there are two problems with this description:

  1. The phrase "let statements" only appears in the section on "type coercions", and even there its meaning is only hinted at by example. Maybe this should somehow refer to the section on "declaration statements" (which itself doesn't currently mention let)?
  2. The phrase "refutable let statements" is nowhere defined in the document. The section on functions mentions "function arguments are irrefutable patterns", but the notion of refutability doesn't get a good treatment. There are examples, which do help, but this is not necessarily the same thing as explaining it in prose, and a prose description would provide a place to hyperlink to.

(All this being said, I did clear up my own confusion on this by being able to look at the examples, which are super-helpful.)

@jdm jdm added the A-docs label Nov 12, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
First, re-word the section on if let/while let to be more clear.

Second, actually call them let statements in the statement section

Fixes rust-lang#29801
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
First, re-word the section on if let/while let to be more clear.

Second, actually call them let statements in the statement section

Fixes rust-lang#29801
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
First, re-word the section on if let/while let to be more clear.

Second, actually call them let statements in the statement section

Fixes rust-lang#29801
dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
First, re-word the section on if let/while let to be more clear.

Second, actually call them let statements in the statement section

Fixes rust-lang#29801
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

No branches or pull requests

2 participants