diff options
| author | blake2-ppc <blake2-ppc> | 2013-08-01 04:18:19 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-08-01 16:54:22 +0200 |
| commit | 78cde5b9fb9db91f954f7fe4afdd230de6754e54 (patch) | |
| tree | 524e26fcde0b5f86f453eac7768b4881d6f979fc /src/libstd/rt/select.rs | |
| parent | 7e210a8129c844e0b3aca4a28153effd0817ef41 (diff) | |
std: Change `Times` trait to use `do` instead of `for`
Change the former repetition::
for 5.times { }
to::
do 5.times { }
.times() cannot be broken with `break` or `return` anymore; for those
cases, use a numerical range loop instead.
Diffstat (limited to 'src/libstd/rt/select.rs')
| -rw-r--r-- | src/libstd/rt/select.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/rt/select.rs b/src/libstd/rt/select.rs index 6296186aa49..aba42ee92c3 100644 --- a/src/libstd/rt/select.rs +++ b/src/libstd/rt/select.rs @@ -187,7 +187,7 @@ mod test { do run_in_newsched_task { let (ports, _) = unzip(from_fn(10, |_| stream())); let (port, chan) = stream(); - for 10.times { chan.send(31337); } + do 10.times { chan.send(31337); } let mut ports = ports; let mut port = Some(port); let order = [5u,0,4,3,2,6,9,8,7,1]; @@ -268,7 +268,7 @@ mod test { do run_in_newsched_task { // A bit of stress, since ordinarily this is just smoke and mirrors. - for 4.times { + do 4.times { let send_on_chans = send_on_chans.clone(); do task::spawn { let mut ports = ~[]; |
