From 8b98e5a296d95c5e832db0756828e5bec31c6f50 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 20 Dec 2012 17:01:38 -0800 Subject: [PATCH] doc: Mention argument bindings in manual --- doc/rust.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/rust.md b/doc/rust.md index 3a3c371accdfd..210e07d198acc 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