diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-12-20 17:01:38 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-12-20 17:01:38 -0800 |
| commit | 8b98e5a296d95c5e832db0756828e5bec31c6f50 (patch) | |
| tree | 6586c52a1d666503f09a534b378017638d32dd2c | |
| parent | 45e62d0a144f336e2ad849c1bb7767a12f312643 (diff) | |
| download | rust-0.5.tar.gz rust-0.5.zip | |
doc: Mention argument bindings in manual release-0.5 0.5
| -rw-r--r-- | doc/rust.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/rust.md b/doc/rust.md index 3a3c371accd..210e07d198a 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -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 |
