auto merge of #11672 : bjz/rust/remove-times, r=brson

`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal (which I liked) was then lost after `do` was disabled for closures. It's time to let this one go.
This commit is contained in:
bors 2014-01-29 20:06:36 -08:00
commit 3cb72a3655
47 changed files with 151 additions and 200 deletions

View file

@ -355,15 +355,15 @@ mod test {
iotest!(fn multiple_connect_serial_ip4() {
let addr = next_test_ip4();
let max = 10;
let max = 10u;
let (port, chan) = Chan::new();
spawn(proc() {
port.recv();
max.times(|| {
for _ in range(0, max) {
let mut stream = TcpStream::connect(addr);
stream.write([99]);
});
}
});
let mut acceptor = TcpListener::bind(addr).listen();
@ -377,15 +377,15 @@ mod test {
iotest!(fn multiple_connect_serial_ip6() {
let addr = next_test_ip6();
let max = 10;
let max = 10u;
let (port, chan) = Chan::new();
spawn(proc() {
port.recv();
max.times(|| {
for _ in range(0, max) {
let mut stream = TcpStream::connect(addr);
stream.write([99]);
});
}
});
let mut acceptor = TcpListener::bind(addr).listen();

View file

@ -234,20 +234,20 @@ mod tests {
spawn(proc() {
port.recv();
times.times(|| {
for _ in range(0, times) {
let mut stream = UnixStream::connect(&path2);
stream.write([100]);
})
}
});
let mut acceptor = UnixListener::bind(&path1).listen();
chan.send(());
times.times(|| {
for _ in range(0, times) {
let mut client = acceptor.accept();
let mut buf = [0];
client.read(buf);
assert_eq!(buf[0], 100);
})
}
}
#[test]