Skip to content

Commit 8b98e5a

Browse files
committed
doc: Mention argument bindings in manual
1 parent 45e62d0 commit 8b98e5a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/rust.md

+7
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,13 @@ fn add(x: int, y: int) -> int {
876876
}
877877
~~~~
878878

879+
As with `let` bindings, function arguments are irrefutable patterns,
880+
so any pattern that is valid in a let binding is also valid as an argument.
881+
882+
~~~
883+
fn first((value, _): (int, int)) -> int { value }
884+
~~~
885+
879886

880887
#### Generic functions
881888

0 commit comments

Comments
 (0)