diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2015-01-25 22:05:03 +0100 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2015-01-30 04:38:54 +0100 |
| commit | 7f64fe4e27555c256cb228feb05d4181a2287125 (patch) | |
| tree | c1fd374d345905c7c4c9b1e7df160d3394edbec5 /src/libstd/sync | |
| parent | 52c74e63dacd49017b19330e0cbecbac0a3fe62e (diff) | |
| download | rust-7f64fe4e27555c256cb228feb05d4181a2287125.tar.gz rust-7f64fe4e27555c256cb228feb05d4181a2287125.zip | |
Remove all `i` suffixes
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/future.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 46 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mpsc_queue.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/spsc_queue.rs | 16 | ||||
| -rw-r--r-- | src/libstd/sync/mutex.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/once.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 14 |
8 files changed, 50 insertions, 50 deletions
diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index a79fb684f47..8340652d19a 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -193,7 +193,7 @@ mod test { #[test] fn test_get_ref_method() { - let mut f = Future::from_value(22i); + let mut f = Future::from_value(22); assert_eq!(*f.get_ref(), 22); } diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 6a43eccbaba..b77631935b9 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -59,9 +59,9 @@ //! // Create a simple streaming channel //! let (tx, rx) = channel(); //! Thread::spawn(move|| { -//! tx.send(10i).unwrap(); +//! tx.send(10).unwrap(); //! }); -//! assert_eq!(rx.recv().unwrap(), 10i); +//! assert_eq!(rx.recv().unwrap(), 10); //! ``` //! //! Shared usage: @@ -74,14 +74,14 @@ //! // where tx is the sending half (tx for transmission), and rx is the receiving //! // half (rx for receiving). //! let (tx, rx) = channel(); -//! for i in 0i..10i { +//! for i in 0..10 { //! let tx = tx.clone(); //! Thread::spawn(move|| { //! tx.send(i).unwrap(); //! }); //! } //! -//! for _ in 0i..10i { +//! for _ in 0..10 { //! let j = rx.recv().unwrap(); //! assert!(0 <= j && j < 10); //! } @@ -514,15 +514,15 @@ pub fn channel<T: Send>() -> (Sender<T>, Receiver<T>) { /// let (tx, rx) = sync_channel(1); /// /// // this returns immediately -/// tx.send(1i).unwrap(); +/// tx.send(1).unwrap(); /// /// Thread::spawn(move|| { /// // this will block until the previous message has been received -/// tx.send(2i).unwrap(); +/// tx.send(2).unwrap(); /// }); /// -/// assert_eq!(rx.recv().unwrap(), 1i); -/// assert_eq!(rx.recv().unwrap(), 2i); +/// assert_eq!(rx.recv().unwrap(), 1); +/// assert_eq!(rx.recv().unwrap(), 2); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn sync_channel<T: Send>(bound: uint) -> (SyncSender<T>, Receiver<T>) { @@ -562,11 +562,11 @@ impl<T: Send> Sender<T> { /// let (tx, rx) = channel(); /// /// // This send is always successful - /// tx.send(1i).unwrap(); + /// tx.send(1).unwrap(); /// /// // This send will fail because the receiver is gone /// drop(rx); - /// assert_eq!(tx.send(1i).err().unwrap().0, 1); + /// assert_eq!(tx.send(1).err().unwrap().0, 1); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn send(&self, t: T) -> Result<(), SendError<T>> { @@ -1045,7 +1045,7 @@ mod test { #[test] fn drop_full() { let (tx, _rx) = channel(); - tx.send(box 1i).unwrap(); + tx.send(box 1).unwrap(); } #[test] @@ -1053,7 +1053,7 @@ mod test { let (tx, _rx) = channel(); drop(tx.clone()); drop(tx.clone()); - tx.send(box 1i).unwrap(); + tx.send(box 1).unwrap(); } #[test] @@ -1147,7 +1147,7 @@ mod test { fn stress() { let (tx, rx) = channel::<int>(); let t = Thread::scoped(move|| { - for _ in 0u..10000 { tx.send(1i).unwrap(); } + for _ in 0u..10000 { tx.send(1).unwrap(); } }); for _ in 0u..10000 { assert_eq!(rx.recv().unwrap(), 1); @@ -1187,13 +1187,13 @@ mod test { let (tx2, rx2) = channel::<int>(); let t1 = Thread::scoped(move|| { tx1.send(()).unwrap(); - for _ in 0i..40 { + for _ in 0..40 { assert_eq!(rx2.recv().unwrap(), 1); } }); rx1.recv().unwrap(); let t2 = Thread::scoped(move|| { - for _ in 0i..40 { + for _ in 0..40 { tx2.send(1).unwrap(); } }); @@ -1205,7 +1205,7 @@ mod test { fn recv_from_outside_runtime() { let (tx, rx) = channel::<int>(); let t = Thread::scoped(move|| { - for _ in 0i..40 { + for _ in 0..40 { assert_eq!(rx.recv().unwrap(), 1); } }); @@ -1391,9 +1391,9 @@ mod test { for _ in 0..stress_factor() { let (tx, rx) = channel(); let _t = Thread::spawn(move|| { - tx.send(box 10i).unwrap(); + tx.send(box 10).unwrap(); }); - assert!(rx.recv().unwrap() == box 10i); + assert!(rx.recv().unwrap() == box 10); } } @@ -1429,8 +1429,8 @@ mod test { fn recv_a_lot() { // Regression test that we don't run out of stack in scheduler context let (tx, rx) = channel(); - for _ in 0i..10000 { tx.send(()).unwrap(); } - for _ in 0i..10000 { rx.recv().unwrap(); } + for _ in 0..10000 { tx.send(()).unwrap(); } + for _ in 0..10000 { rx.recv().unwrap(); } } #[test] @@ -1567,7 +1567,7 @@ mod sync_tests { #[test] fn drop_full() { let (tx, _rx) = sync_channel(1); - tx.send(box 1i).unwrap(); + tx.send(box 1).unwrap(); } #[test] @@ -1855,9 +1855,9 @@ mod sync_tests { for _ in 0..stress_factor() { let (tx, rx) = sync_channel::<Box<int>>(0); let _t = Thread::spawn(move|| { - tx.send(box 10i).unwrap(); + tx.send(box 10).unwrap(); }); - assert!(rx.recv().unwrap() == box 10i); + assert!(rx.recv().unwrap() == box 10); } } diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 53eba131674..3980d2a1fef 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -165,8 +165,8 @@ mod tests { #[test] fn test_full() { let q = Queue::new(); - q.push(box 1i); - q.push(box 2i); + q.push(box 1); + q.push(box 2); } #[test] diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index f70e2dee8ee..85c7572404b 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -32,15 +32,15 @@ //! let (tx1, rx1) = channel(); //! let (tx2, rx2) = channel(); //! -//! tx1.send(1i).unwrap(); -//! tx2.send(2i).unwrap(); +//! tx1.send(1).unwrap(); +//! tx2.send(2).unwrap(); //! //! select! { //! val = rx1.recv() => { -//! assert_eq!(val.unwrap(), 1i); +//! assert_eq!(val.unwrap(), 1); //! }, //! val = rx2.recv() => { -//! assert_eq!(val.unwrap(), 2i); +//! assert_eq!(val.unwrap(), 2); //! } //! } //! ``` diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs index 45503f0b58e..c80aa567173 100644 --- a/src/libstd/sync/mpsc/spsc_queue.rs +++ b/src/libstd/sync/mpsc/spsc_queue.rs @@ -253,9 +253,9 @@ mod test { fn smoke() { unsafe { let queue = Queue::new(0); - queue.push(1i); + queue.push(1); queue.push(2); - assert_eq!(queue.pop(), Some(1i)); + assert_eq!(queue.pop(), Some(1)); assert_eq!(queue.pop(), Some(2)); assert_eq!(queue.pop(), None); queue.push(3); @@ -270,7 +270,7 @@ mod test { fn peek() { unsafe { let queue = Queue::new(0); - queue.push(vec![1i]); + queue.push(vec![1]); // Ensure the borrowchecker works match queue.peek() { @@ -290,8 +290,8 @@ mod test { fn drop_full() { unsafe { let q = Queue::new(0); - q.push(box 1i); - q.push(box 2i); + q.push(box 1); + q.push(box 2); } } @@ -299,7 +299,7 @@ mod test { fn smoke_bound() { unsafe { let q = Queue::new(0); - q.push(1i); + q.push(1); q.push(2); assert_eq!(q.pop(), Some(1)); assert_eq!(q.pop(), Some(2)); @@ -328,7 +328,7 @@ mod test { for _ in 0u..100000 { loop { match q2.pop() { - Some(1i) => break, + Some(1) => break, Some(_) => panic!(), None => {} } @@ -336,7 +336,7 @@ mod test { } tx.send(()).unwrap(); }); - for _ in 0i..100000 { + for _ in 0..100000 { q.push(1); } rx.recv().unwrap(); diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index c31010c170d..7531d5b058d 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -428,7 +428,7 @@ mod test { #[test] fn test_arc_condvar_poison() { - let packet = Packet(Arc::new((Mutex::new(1i), Condvar::new()))); + let packet = Packet(Arc::new((Mutex::new(1), Condvar::new()))); let packet2 = Packet(packet.0.clone()); let (tx, rx) = channel(); @@ -457,7 +457,7 @@ mod test { #[test] fn test_mutex_arc_poison() { - let arc = Arc::new(Mutex::new(1i)); + let arc = Arc::new(Mutex::new(1)); let arc2 = arc.clone(); let _ = Thread::scoped(move|| { let lock = arc2.lock().unwrap(); @@ -470,7 +470,7 @@ mod test { fn test_mutex_arc_nested() { // Tests nested mutexes and access // to underlying data. - let arc = Arc::new(Mutex::new(1i)); + let arc = Arc::new(Mutex::new(1)); let arc2 = Arc::new(Mutex::new(arc)); let (tx, rx) = channel(); let _t = Thread::spawn(move|| { @@ -484,7 +484,7 @@ mod test { #[test] fn test_mutex_arc_access_in_unwind() { - let arc = Arc::new(Mutex::new(1i)); + let arc = Arc::new(Mutex::new(1)); let arc2 = arc.clone(); let _ = Thread::scoped(move|| -> () { struct Unwinder { diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 0604003cecd..2df211f3768 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -134,7 +134,7 @@ mod test { #[test] fn smoke_once() { static O: Once = ONCE_INIT; - let mut a = 0i; + let mut a = 0; O.call_once(|| a += 1); assert_eq!(a, 1); O.call_once(|| a += 1); diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index b5817ad64f6..95b570dd9c8 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -41,7 +41,7 @@ use sys_common::rwlock as sys; /// ``` /// use std::sync::RwLock; /// -/// let lock = RwLock::new(5i); +/// let lock = RwLock::new(5); /// /// // many reader locks can be held at once /// { @@ -437,7 +437,7 @@ mod tests { #[test] fn test_rw_arc_poison_wr() { - let arc = Arc::new(RwLock::new(1i)); + let arc = Arc::new(RwLock::new(1)); let arc2 = arc.clone(); let _: Result<uint, _> = Thread::scoped(move|| { let _lock = arc2.write().unwrap(); @@ -448,7 +448,7 @@ mod tests { #[test] fn test_rw_arc_poison_ww() { - let arc = Arc::new(RwLock::new(1i)); + let arc = Arc::new(RwLock::new(1)); let arc2 = arc.clone(); let _: Result<uint, _> = Thread::scoped(move|| { let _lock = arc2.write().unwrap(); @@ -459,7 +459,7 @@ mod tests { #[test] fn test_rw_arc_no_poison_rr() { - let arc = Arc::new(RwLock::new(1i)); + let arc = Arc::new(RwLock::new(1)); let arc2 = arc.clone(); let _: Result<uint, _> = Thread::scoped(move|| { let _lock = arc2.read().unwrap(); @@ -470,7 +470,7 @@ mod tests { } #[test] fn test_rw_arc_no_poison_rw() { - let arc = Arc::new(RwLock::new(1i)); + let arc = Arc::new(RwLock::new(1)); let arc2 = arc.clone(); let _: Result<uint, _> = Thread::scoped(move|| { let _lock = arc2.read().unwrap(); @@ -482,7 +482,7 @@ mod tests { #[test] fn test_rw_arc() { - let arc = Arc::new(RwLock::new(0i)); + let arc = Arc::new(RwLock::new(0)); let arc2 = arc.clone(); let (tx, rx) = channel(); @@ -520,7 +520,7 @@ mod tests { #[test] fn test_rw_arc_access_in_unwind() { - let arc = Arc::new(RwLock::new(1i)); + let arc = Arc::new(RwLock::new(1)); let arc2 = arc.clone(); let _ = Thread::scoped(move|| -> () { struct Unwinder { |
