about summary refs log tree commit diff
path: root/src/libstd/sync/task_pool.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-29 16:28:52 +0000
committerbors <bors@rust-lang.org>2015-01-29 16:28:52 +0000
commit265a23320dbeaeca45b889cfea684d71dec1b8e6 (patch)
tree36775481b19e207f139d108aeb88875b695de181 /src/libstd/sync/task_pool.rs
parent3d6f5100aff24aa97275dc92ade728caac605560 (diff)
parenta6f9180fd61f509ebc6d666eda3f6bb42dd02573 (diff)
downloadrust-265a23320dbeaeca45b889cfea684d71dec1b8e6.tar.gz
rust-265a23320dbeaeca45b889cfea684d71dec1b8e6.zip
Auto merge of #21677 - japaric:no-range, r=alexcrichton
Note: Do not merge until we get a newer snapshot that includes #21374

There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672).

r? @alexcrichton 
Diffstat (limited to 'src/libstd/sync/task_pool.rs')
-rw-r--r--src/libstd/sync/task_pool.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/sync/task_pool.rs b/src/libstd/sync/task_pool.rs
index 3fac998d3e7..1bfcbcf96f1 100644
--- a/src/libstd/sync/task_pool.rs
+++ b/src/libstd/sync/task_pool.rs
@@ -66,7 +66,7 @@ impl<'a> Drop for Sentinel<'a> {
 /// let pool = TaskPool::new(4u);
 ///
 /// let (tx, rx) = channel();
-/// for _ in range(0, 8u) {
+/// for _ in 0..8u {
 ///     let tx = tx.clone();
 ///     pool.execute(move|| {
 ///         tx.send(1u).unwrap();
@@ -96,7 +96,7 @@ impl TaskPool {
         let rx = Arc::new(Mutex::new(rx));
 
         // Threadpool threads
-        for _ in range(0, threads) {
+        for _ in 0..threads {
             spawn_in_pool(rx.clone());
         }
 
@@ -151,7 +151,7 @@ mod test {
         let pool = TaskPool::new(TEST_TASKS);
 
         let (tx, rx) = channel();
-        for _ in range(0, TEST_TASKS) {
+        for _ in 0..TEST_TASKS {
             let tx = tx.clone();
             pool.execute(move|| {
                 tx.send(1u).unwrap();
@@ -174,13 +174,13 @@ mod test {
         let pool = TaskPool::new(TEST_TASKS);
 
         // Panic all the existing threads.
-        for _ in range(0, TEST_TASKS) {
+        for _ in 0..TEST_TASKS {
             pool.execute(move|| -> () { panic!() });
         }
 
         // Ensure new threads were spawned to compensate.
         let (tx, rx) = channel();
-        for _ in range(0, TEST_TASKS) {
+        for _ in 0..TEST_TASKS {
             let tx = tx.clone();
             pool.execute(move|| {
                 tx.send(1u).unwrap();
@@ -198,7 +198,7 @@ mod test {
         let waiter = Arc::new(Barrier::new(TEST_TASKS + 1));
 
         // Panic all the existing threads in a bit.
-        for _ in range(0, TEST_TASKS) {
+        for _ in 0..TEST_TASKS {
             let waiter = waiter.clone();
             pool.execute(move|| {
                 waiter.wait();