about summary refs log tree commit diff
path: root/src/doc/tutorial.md
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2014-03-28 20:42:34 +0100
committerMarvin Löbel <loebel.marvin@gmail.com>2014-03-30 03:47:04 +0200
commitc356e3ba6a12c3294a9a428ef9120cff9306bf4b (patch)
treed5f8701b97fcf2fc596a52215ad96462c1eb981e /src/doc/tutorial.md
parent86890b9e7c5db28ac2da5cd63d1a51d63a5e6bec (diff)
downloadrust-c356e3ba6a12c3294a9a428ef9120cff9306bf4b.tar.gz
rust-c356e3ba6a12c3294a9a428ef9120cff9306bf4b.zip
Removed deprecated functions `map` and `flat_map` for vectors and slices.
Diffstat (limited to 'src/doc/tutorial.md')
-rw-r--r--src/doc/tutorial.md5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md
index b0d9e3e9802..e15145e5f1d 100644
--- a/src/doc/tutorial.md
+++ b/src/doc/tutorial.md
@@ -1764,7 +1764,10 @@ access local variables in the enclosing scope.
 
 ~~~~
 let mut max = 0;
-[1, 2, 3].map(|x| if *x > max { max = *x });
+let f = |x: int| if x > max { max = x };
+for x in [1, 2, 3].iter() {
+    f(*x);
+}
 ~~~~
 
 Stack closures are very efficient because their environment is