diff options
| author | bors <bors@rust-lang.org> | 2013-04-28 19:36:36 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-04-28 19:36:36 -0700 |
| commit | 7b7a0fc235cd2e0782302cd6fb83634e190b15b7 (patch) | |
| tree | c4d6aedddc64db81f6ada877e9ec585cf981d2d9 /src/libstd/timer.rs | |
| parent | 9f03d45c56b37b36912c16bd5b4fb4723fd91cb7 (diff) | |
| parent | 46f91a0fa95cd13f7433a1d72d087283f483a4b8 (diff) | |
| download | rust-7b7a0fc235cd2e0782302cd6fb83634e190b15b7.tar.gz rust-7b7a0fc235cd2e0782302cd6fb83634e190b15b7.zip | |
auto merge of #6056 : thestinger/rust/iter, r=catamorphism
The existing adaptors like `map` in the `iter` module are very flawed because they only work for `BaseIter` implementations. There are many internal iterator implementations in the standard library like the set methods (`difference`, `symmetric_difference`, `intersection`, `union`) and the `range` functions that only share the `for` loop protocol in common. The internal iterator adaptors should be implemented to work on any implementation of that protocol, rather than just a method called `each` taking `&self`. This just moves `iter.rs` to `old_iter.rs` and begins work on documenting and implementing a nicer module.
Diffstat (limited to 'src/libstd/timer.rs')
| -rw-r--r-- | src/libstd/timer.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index a36a6da4653..69e01d4e4db 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -183,7 +183,7 @@ mod test { #[test] fn test_gl_timer_sleep_stress1() { let hl_loop = &uv::global_loop::get(); - for iter::repeat(50u) { + for old_iter::repeat(50u) { sleep(hl_loop, 1u); } } @@ -203,7 +203,7 @@ mod test { }; - for iter::repeat(repeat) { + for old_iter::repeat(repeat) { let ch = ch.clone(); for spec.each |spec| { @@ -213,7 +213,7 @@ mod test { do task::spawn { use core::rand::*; let rng = rng(); - for iter::repeat(times) { + for old_iter::repeat(times) { sleep(&hl_loop_clone, rng.next() as uint % maxms); } ch.send(()); @@ -221,7 +221,7 @@ mod test { } } - for iter::repeat(repeat * spec.len()) { + for old_iter::repeat(repeat * spec.len()) { po.recv() } } @@ -239,7 +239,7 @@ mod test { let mut failures = 0; let hl_loop = uv::global_loop::get(); - for iter::repeat(times as uint) { + for old_iter::repeat(times as uint) { task::yield(); let expected = rand::rng().gen_str(16u); @@ -268,7 +268,7 @@ mod test { let mut failures = 0; let hl_loop = uv::global_loop::get(); - for iter::repeat(times as uint) { + for old_iter::repeat(times as uint) { let expected = rand::rng().gen_str(16u); let (test_po, test_ch) = stream::<~str>(); let hl_loop_clone = hl_loop.clone(); |
