@@ -39,7 +39,7 @@ fn show_color(cc: color) -> ~str {
39
39
}
40
40
}
41
41
42
- fn show_color_list ( set : ~ [ color ] ) -> ~str {
42
+ fn show_color_list ( set : vec ! ( color) ) -> ~str {
43
43
let mut out = ~"";
44
44
for col in set. iter ( ) {
45
45
out. push_char ( ' ' ) ;
@@ -132,7 +132,7 @@ fn creature(
132
132
}
133
133
}
134
134
135
- fn rendezvous(nn: uint, set: ~[ color] ) {
135
+ fn rendezvous(nn: uint, set: vec!( color) ) {
136
136
137
137
// these ports will allow us to hear from the creatures
138
138
let (to_rendezvous, from_creatures) = channel::<CreatureInfo>();
@@ -141,7 +141,7 @@ fn rendezvous(nn: uint, set: ~[color]) {
141
141
// these channels will be passed to the creatures so they can talk to us
142
142
143
143
// these channels will allow us to talk to each creature by 'name'/index
144
- let to_creature: ~[ Sender<Option<CreatureInfo>>] =
144
+ let to_creature: Vec< Sender<Option<CreatureInfo>>> =
145
145
set.iter().enumerate().map(|(ii, col)| {
146
146
// create each creature as a listener with a port, and
147
147
// give us a channel to talk to each
@@ -179,7 +179,7 @@ fn rendezvous(nn: uint, set: ~[color]) {
179
179
}
180
180
181
181
// save each creature's meeting stats
182
- let mut report = ~[] ;
182
+ let mut report = Vec::new() ;
183
183
for _to_one in to_creature.iter() {
184
184
report.push(from_creatures_log.recv());
185
185
}
@@ -199,9 +199,9 @@ fn rendezvous(nn: uint, set: ~[color]) {
199
199
fn main() {
200
200
let args = os::args();
201
201
let args = if os::getenv(" RUST_BENCH ") . is_some ( ) {
202
- ~ [ ~ "", ~"200000 "]
202
+ vec ! ( ~ "", ~"200000 ")
203
203
} else if args.len() <= 1u {
204
- ~ [ ~ "", ~"600 "]
204
+ vec!(~ " ", ~" 600 ")
205
205
} else {
206
206
args
207
207
};
@@ -211,9 +211,9 @@ fn main() {
211
211
print_complements();
212
212
println!(" ");
213
213
214
- rendezvous ( nn, ~ [ Blue , Red , Yellow ] ) ;
214
+ rendezvous(nn, vec!( Blue, Red, Yellow) );
215
215
println!(" " ) ;
216
216
217
217
rendezvous ( nn,
218
- ~ [ Blue , Red , Yellow , Red , Yellow , Blue , Red , Yellow , Red , Blue ] ) ;
218
+ vec ! ( Blue , Red , Yellow , Red , Yellow , Blue , Red , Yellow , Red , Blue ) ) ;
219
219
}
0 commit comments