Get rid of some remaining uses of old style vecs.

This commit is contained in:
Michael Sullivan 2012-07-10 16:29:00 -07:00
parent 61f4aaa6d2
commit a83ed81f77
2 changed files with 3 additions and 3 deletions

View file

@ -111,7 +111,7 @@ fn main() {
let rng = seeded_rng(seed());
// A small inline function for picking an RPS gesture
let pick = || [rock, paper, scissors][rng.gen_uint() % 3];
let pick = || (~[rock, paper, scissors])[rng.gen_uint() % 3];
// Pick two gestures and decide the result
alt (pick(), pick()) {
@ -1581,7 +1581,7 @@ access local variables in the enclosing scope.
~~~~
let mut max = 0;
[1, 2, 3].map(|x| if x > max { max = x });
(~[1, 2, 3]).map(|x| if x > max { max = x });
~~~~
Stack closures are very efficient because their environment is

View file

@ -67,7 +67,7 @@ for t in stage2_tests:
p = p.replace("\\", "\\\\")
d.write(" out.write_str(\"run-pass [stage2]: %s\\n\");\n" % p)
if t in take_args:
d.write(" t_%d::main([\"arg0\"]);\n" % i)
d.write(" t_%d::main(~[\"arg0\"]);\n" % i)
else:
d.write(" t_%d::main();\n" % i)
i += 1