doc: Mention argument bindings in manual
This commit is contained in:
parent
45e62d0a14
commit
8b98e5a296
1 changed files with 7 additions and 0 deletions
|
@ -876,6 +876,13 @@ fn add(x: int, y: int) -> int {
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
As with `let` bindings, function arguments are irrefutable patterns,
|
||||||
|
so any pattern that is valid in a let binding is also valid as an argument.
|
||||||
|
|
||||||
|
~~~
|
||||||
|
fn first((value, _): (int, int)) -> int { value }
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
#### Generic functions
|
#### Generic functions
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue