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