Skip to content

Commit e454a47

Browse files
committed
[tutorial] Use a less confusing closure example
Closes #3996
1 parent 55ca361 commit e454a47

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

doc/tutorial.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,8 +1540,7 @@ them. In the rare case where the compiler needs assistance, though, the
15401540
arguments and return types may be annotated.
15411541

15421542
~~~~
1543-
# type mygoodness = fn(~str) -> ~str; type what_the = int;
1544-
let bloop = |well, oh: mygoodness| -> what_the { fail oh(well) };
1543+
let square = |x: int| -> uint { x * x as uint };
15451544
~~~~
15461545

15471546
There are several forms of closure, each with its own role. The most

0 commit comments

Comments
 (0)