Skip to content

Commit f016668

Browse files
bstriecatamorphism
authored andcommitted
---
yaml --- r: 34779 b: refs/heads/master c: f7ce3dc h: refs/heads/master i: 34777: adb2b88 34775: bd29f78 v: v3
1 parent 474da41 commit f016668

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5e1d0bab8075df5ce06543537296d7294440bd45
2+
refs/heads/master: f7ce3dc55f1bcc8a741951a4b9f090bad61769ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/doc/tutorial.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ and [`core::str`]. Here are some examples.
15041504
# fn store_crayon_in_nasal_cavity(i: uint, c: Crayon) { }
15051505
# fn crayon_to_str(c: Crayon) -> &str { "" }
15061506
1507-
let crayons = &[Almond, AntiqueBrass, Apricot];
1507+
let crayons = [Almond, AntiqueBrass, Apricot];
15081508
15091509
// Check the length of the vector
15101510
assert crayons.len() == 3;
@@ -1679,7 +1679,7 @@ structure.
16791679
~~~~
16801680
# fn each(v: &[int], op: fn(v: &int)) { }
16811681
# fn do_some_work(i: &int) { }
1682-
each(&[1, 2, 3], |n| {
1682+
each([1, 2, 3], |n| {
16831683
do_some_work(n);
16841684
});
16851685
~~~~
@@ -1690,7 +1690,7 @@ call that can be written more like a built-in control structure:
16901690
~~~~
16911691
# fn each(v: &[int], op: fn(v: &int)) { }
16921692
# fn do_some_work(i: &int) { }
1693-
do each(&[1, 2, 3]) |n| {
1693+
do each([1, 2, 3]) |n| {
16941694
do_some_work(n);
16951695
}
16961696
~~~~
@@ -1751,7 +1751,7 @@ And using this function to iterate over a vector:
17511751
~~~~
17521752
# use each = vec::each;
17531753
# use println = io::println;
1754-
each(&[2, 4, 8, 5, 16], |n| {
1754+
each([2, 4, 8, 5, 16], |n| {
17551755
if *n % 2 != 0 {
17561756
println("found odd number!");
17571757
false
@@ -1768,7 +1768,7 @@ to the next iteration, write `loop`.
17681768
~~~~
17691769
# use each = vec::each;
17701770
# use println = io::println;
1771-
for each(&[2, 4, 8, 5, 16]) |n| {
1771+
for each([2, 4, 8, 5, 16]) |n| {
17721772
if *n % 2 != 0 {
17731773
println("found odd number!");
17741774
break;
@@ -2106,7 +2106,7 @@ impl @Rectangle: Drawable { fn draw() { ... } }
21062106
21072107
let c: @Circle = @new_circle();
21082108
let r: @Rectangle = @new_rectangle();
2109-
draw_all(&[c as @Drawable, r as @Drawable]);
2109+
draw_all([c as @Drawable, r as @Drawable]);
21102110
~~~~
21112111

21122112
We omit the code for `new_circle` and `new_rectangle`; imagine that

0 commit comments

Comments
 (0)