-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
doc: improve/fix 'let' FAQ #24554
doc: improve/fix 'let' FAQ #24554
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ rollup |
📌 Commit 4665c3b has been approved by |
`while let` and `match`. Bindings also exist in function arguments positions. | ||
Instead of the term "variable", we use "variable bindings". The | ||
simplest way for creating a binding is by using the `let` syntax. | ||
Other ways include `if let`, `while let`, and `match`. Bindings also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing is missing here: for-in also do pattern matching.
edit: fix typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has now be merged, so you can create a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about "Other ways include if let
, while let
, match
and for ... in
. "?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While doing this PR, I was actually thinking maybe it should a bullet list:
Other ways of creating bindings:
if let
while let
- ...
BTW, for item in items
is a nice catch... I forgot about it.
No description provided.