Rollup merge of #28485 - Wallacoloo:clarify-let-lhs, r=alexcrichton
In code like `let x = 5`, I am initially confused as to the meaning of "let doesn't take a name on the left hand side, it actually accepts a pattern." - I interpret that as the pattern being located as: `<pattern> let [...]`. I think what is meant is that the name/pattern is on the left hand side *of the assignment*, rather than to the left of the *let* statement. This change clarifies that.
This commit is contained in:
commit
d557f4a60f
@ -147,7 +147,7 @@ a few tricks up their sleeves.
|
||||
|
||||
For example, they’re [immutable][immutable] by default. That’s why our example
|
||||
uses `mut`: it makes a binding mutable, rather than immutable. `let` doesn’t
|
||||
take a name on the left hand side, it actually accepts a
|
||||
take a name on the left hand side of the assignment, it actually accepts a
|
||||
‘[pattern][patterns]’. We’ll use patterns later. It’s easy enough
|
||||
to use for now:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user