Skip to content

Commit a83ed81

Browse files
committed
Get rid of some remaining uses of old style vecs.
1 parent 61f4aaa commit a83ed81

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/tutorial.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn main() {
111111
112112
let rng = seeded_rng(seed());
113113
// A small inline function for picking an RPS gesture
114-
let pick = || [rock, paper, scissors][rng.gen_uint() % 3];
114+
let pick = || (~[rock, paper, scissors])[rng.gen_uint() % 3];
115115
116116
// Pick two gestures and decide the result
117117
alt (pick(), pick()) {
@@ -1581,7 +1581,7 @@ access local variables in the enclosing scope.
15811581
15821582
~~~~
15831583
let mut max = 0;
1584-
[1, 2, 3].map(|x| if x > max { max = x });
1584+
(~[1, 2, 3]).map(|x| if x > max { max = x });
15851585
~~~~
15861586
15871587
Stack closures are very efficient because their environment is

src/etc/combine-tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def scrub(b):
6767
p = p.replace("\\", "\\\\")
6868
d.write(" out.write_str(\"run-pass [stage2]: %s\\n\");\n" % p)
6969
if t in take_args:
70-
d.write(" t_%d::main([\"arg0\"]);\n" % i)
70+
d.write(" t_%d::main(~[\"arg0\"]);\n" % i)
7171
else:
7272
d.write(" t_%d::main();\n" % i)
7373
i += 1

0 commit comments

Comments
 (0)