From 8f4371434c483976a7490e61274cd566b8ddeca6 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg <42micro@gmail.com> Date: Fri, 24 Apr 2015 00:54:11 -0400 Subject: [PATCH] More small syntax changes in reference.md --- src/doc/reference.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/reference.md b/src/doc/reference.md index d918a320e63a9..fe674614a97e4 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2640,7 +2640,7 @@ parentheses. They are used to create [tuple-typed](#tuple-types) values. ```{.tuple} (0,); (0.0, 4.5); -("a", 4us, true); +("a", 4usize, true); ``` ### Unit expressions @@ -3163,7 +3163,7 @@ An example of a for loop over the contents of an array: let v: &[Foo] = &[a, b, c]; -for e in v.iter() { +for e in v { bar(*e); } ``` @@ -3694,12 +3694,12 @@ Within the body of an item that has type parameter declarations, the names of its type parameters are types: ```ignore -fn map(f: |A| -> B, xs: &[A]) -> Vec { +fn map B>(f: F, xs: &[A]) -> Vec { if xs.is_empty() { return vec![]; } let first: B = f(xs[0].clone()); - let mut rest: Vec = map(f, xs.slice(1, xs.len())); + let mut rest: Vec = map(f, &xs[1..]); rest.insert(0, first); return rest; }