mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
doc: Mention argument bindings in manual
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user