diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-09-19 11:15:48 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-09-19 11:15:48 -0400 |
| commit | d557f4a60f8071ec70e9147540d87b4eae153027 (patch) | |
| tree | 03bf2ce367ab19ff4add3bbfbf66908856a59914 | |
| parent | 00d64d6768a321ef8c9784d21e885e9e108e4916 (diff) | |
| parent | cbc9517b023f3484816b59fd13993027c412748d (diff) | |
| download | rust-d557f4a60f8071ec70e9147540d87b4eae153027.tar.gz rust-d557f4a60f8071ec70e9147540d87b4eae153027.zip | |
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.
| -rw-r--r-- | src/doc/trpl/guessing-game.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc/trpl/guessing-game.md b/src/doc/trpl/guessing-game.md index 3a4328562f8..94280aa4a33 100644 --- a/src/doc/trpl/guessing-game.md +++ b/src/doc/trpl/guessing-game.md @@ -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: |
