1
Fork 0

replace explicit calls to vec::each with vec::each_ref, partially demode str

This commit is contained in:
Niko Matsakis 2012-09-18 18:31:59 -07:00
parent e17a3b3194
commit 1be24f0758
77 changed files with 565 additions and 601 deletions

View file

@ -642,6 +642,7 @@ mod tests {
c.send(());
}
}
// Readers try to catch the writer in the act
let mut children = ~[];
for 5.times {
@ -652,8 +653,10 @@ mod tests {
}
}
}
// Wait for children to pass their asserts
for vec::each(children) |r| { future::get(&r); }
for vec::each_ref(children) |r| { future::get(r); }
// Wait for writer to finish
p.recv();
do arc.read |num| { assert *num == 10; }
@ -713,8 +716,8 @@ mod tests {
assert *state == 42;
*state = 31337;
// send to other readers
for vec::each(reader_convos) |x| {
match x {
for vec::each_ref(reader_convos) |x| {
match *x {
(rc, _) => rc.send(()),
}
}
@ -722,8 +725,8 @@ mod tests {
let read_mode = arc.downgrade(write_mode);
do (&read_mode).read |state| {
// complete handshake with other readers
for vec::each(reader_convos) |x| {
match x {
for vec::each_ref(reader_convos) |x| {
match *x {
(_, rp) => rp.recv(),
}
}