diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 12 | ||||
| -rw-r--r-- | src/liballoc/boxed_test.rs | 10 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 42 |
3 files changed, 32 insertions, 32 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 4818e4abaf2..21b9c060f6f 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -39,7 +39,7 @@ //! //! let five = Arc::new(5); //! -//! for _ in 0u..10 { +//! for _ in 0..10 { //! let five = five.clone(); //! //! Thread::spawn(move || { @@ -56,7 +56,7 @@ //! //! let five = Arc::new(Mutex::new(5)); //! -//! for _ in 0u..10 { +//! for _ in 0..10 { //! let five = five.clone(); //! //! Thread::spawn(move || { @@ -101,7 +101,7 @@ use heap::deallocate; /// let numbers: Vec<_> = (0..100u32).map(|i| i as f32).collect(); /// let shared_numbers = Arc::new(numbers); /// -/// for _ in 0u..10 { +/// for _ in 0..10 { /// let child_numbers = shared_numbers.clone(); /// /// Thread::spawn(move || { @@ -661,7 +661,7 @@ mod tests { #[test] fn test_cowarc_clone_make_unique() { - let mut cow0 = Arc::new(75u); + let mut cow0 = Arc::new(75); let mut cow1 = cow0.clone(); let mut cow2 = cow1.clone(); @@ -685,7 +685,7 @@ mod tests { #[test] fn test_cowarc_clone_unique2() { - let mut cow0 = Arc::new(75u); + let mut cow0 = Arc::new(75); let cow1 = cow0.clone(); let cow2 = cow1.clone(); @@ -708,7 +708,7 @@ mod tests { #[test] fn test_cowarc_clone_weak() { - let mut cow0 = Arc::new(75u); + let mut cow0 = Arc::new(75); let cow1_weak = cow0.downgrade(); assert!(75 == *cow0); diff --git a/src/liballoc/boxed_test.rs b/src/liballoc/boxed_test.rs index 4ffb94e7a61..6f6d9ab394d 100644 --- a/src/liballoc/boxed_test.rs +++ b/src/liballoc/boxed_test.rs @@ -30,11 +30,11 @@ struct Test; #[test] fn any_move() { - let a = Box::new(8u) as Box<Any>; + let a = Box::new(8us) as Box<Any>; let b = Box::new(Test) as Box<Any>; match a.downcast::<uint>() { - Ok(a) => { assert!(a == Box::new(8u)); } + Ok(a) => { assert!(a == Box::new(8us)); } Err(..) => panic!() } match b.downcast::<Test>() { @@ -42,7 +42,7 @@ fn any_move() { Err(..) => panic!() } - let a = Box::new(8u) as Box<Any>; + let a = Box::new(8) as Box<Any>; let b = Box::new(Test) as Box<Any>; assert!(a.downcast::<Box<Test>>().is_err()); @@ -51,14 +51,14 @@ fn any_move() { #[test] fn test_show() { - let a = Box::new(8u) as Box<Any>; + let a = Box::new(8) as Box<Any>; let b = Box::new(Test) as Box<Any>; let a_str = format!("{:?}", a); let b_str = format!("{:?}", b); assert_eq!(a_str, "Box<Any>"); assert_eq!(b_str, "Box<Any>"); - static EIGHT: usize = 8us; + static EIGHT: usize = 8; static TEST: Test = Test; let a = &EIGHT as &Any; let b = &TEST as &Any; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 8a542e1b8cb..464f20e9cac 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -266,12 +266,12 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool { /// ``` /// use std::rc::{self, Rc}; /// -/// let x = Rc::new(3u); -/// assert_eq!(rc::try_unwrap(x), Ok(3u)); +/// let x = Rc::new(3); +/// assert_eq!(rc::try_unwrap(x), Ok(3)); /// -/// let x = Rc::new(4u); +/// let x = Rc::new(4); /// let _y = x.clone(); -/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4u))); +/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4))); /// ``` #[inline] #[unstable(feature = "alloc")] @@ -300,9 +300,9 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { /// ``` /// use std::rc::{self, Rc}; /// -/// let mut x = Rc::new(3u); -/// *rc::get_mut(&mut x).unwrap() = 4u; -/// assert_eq!(*x, 4u); +/// let mut x = Rc::new(3); +/// *rc::get_mut(&mut x).unwrap() = 4; +/// assert_eq!(*x, 4); /// /// let _y = x.clone(); /// assert!(rc::get_mut(&mut x).is_none()); @@ -845,7 +845,7 @@ mod tests { #[test] fn is_unique() { - let x = Rc::new(3u); + let x = Rc::new(3); assert!(super::is_unique(&x)); let y = x.clone(); assert!(!super::is_unique(&x)); @@ -893,21 +893,21 @@ mod tests { #[test] fn try_unwrap() { - let x = Rc::new(3u); - assert_eq!(super::try_unwrap(x), Ok(3u)); - let x = Rc::new(4u); + let x = Rc::new(3); + assert_eq!(super::try_unwrap(x), Ok(3)); + let x = Rc::new(4); let _y = x.clone(); - assert_eq!(super::try_unwrap(x), Err(Rc::new(4u))); - let x = Rc::new(5u); + assert_eq!(super::try_unwrap(x), Err(Rc::new(4))); + let x = Rc::new(5); let _w = x.downgrade(); - assert_eq!(super::try_unwrap(x), Err(Rc::new(5u))); + assert_eq!(super::try_unwrap(x), Err(Rc::new(5))); } #[test] fn get_mut() { - let mut x = Rc::new(3u); - *super::get_mut(&mut x).unwrap() = 4u; - assert_eq!(*x, 4u); + let mut x = Rc::new(3); + *super::get_mut(&mut x).unwrap() = 4; + assert_eq!(*x, 4); let y = x.clone(); assert!(super::get_mut(&mut x).is_none()); drop(y); @@ -918,7 +918,7 @@ mod tests { #[test] fn test_cowrc_clone_make_unique() { - let mut cow0 = Rc::new(75u); + let mut cow0 = Rc::new(75); let mut cow1 = cow0.clone(); let mut cow2 = cow1.clone(); @@ -942,7 +942,7 @@ mod tests { #[test] fn test_cowrc_clone_unique2() { - let mut cow0 = Rc::new(75u); + let mut cow0 = Rc::new(75); let cow1 = cow0.clone(); let cow2 = cow1.clone(); @@ -965,7 +965,7 @@ mod tests { #[test] fn test_cowrc_clone_weak() { - let mut cow0 = Rc::new(75u); + let mut cow0 = Rc::new(75); let cow1_weak = cow0.downgrade(); assert!(75 == *cow0); @@ -979,7 +979,7 @@ mod tests { #[test] fn test_show() { - let foo = Rc::new(75u); + let foo = Rc::new(75); assert_eq!(format!("{:?}", foo), "75"); } |
