parent
e46de5381b
commit
57c203ef7f
1 changed files with 6 additions and 1 deletions
|
@ -2206,7 +2206,12 @@ fn main() {
|
|||
}
|
||||
~~~~
|
||||
|
||||
A pattern that's just a variable binding,
|
||||
Patterns that bind variables default to binding to a copy of the matched value. This can be made
|
||||
explicit using the ```copy``` keyword, changed to bind to a borrowed pointer by using the ```ref```
|
||||
keyword, or to a mutable borrowed pointer using ```ref mut```, or the value can be moved into
|
||||
the new binding using ```move```.
|
||||
|
||||
A pattern that's just an identifier,
|
||||
like `Nil` in the previous answer,
|
||||
could either refer to an enum variant that's in scope,
|
||||
or bind a new variable.
|
||||
|
|
Loading…
Reference in a new issue