From 93f2a54609540859d26a30eb833388b20621182b Mon Sep 17 00:00:00 2001 From: srinivasreddy Date: Thu, 10 Mar 2016 21:48:15 +0530 Subject: [PATCH 1/2] first round of removal of integer suffixes --- src/liballoc/arc.rs | 8 ++++---- src/liballoc/rc.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index b5d7279edb006..1dac7dca3485b 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -107,7 +107,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize; /// use std::thread; /// /// fn main() { -/// let numbers: Vec<_> = (0..100u32).collect(); +/// let numbers: Vec<_> = (0..100).collect(); /// let shared_numbers = Arc::new(numbers); /// /// for _ in 0..10 { @@ -1118,7 +1118,7 @@ mod tests { #[test] fn test_strong_count() { - let a = Arc::new(0u32); + let a = Arc::new(0); assert!(Arc::strong_count(&a) == 1); let w = Arc::downgrade(&a); assert!(Arc::strong_count(&a) == 1); @@ -1135,7 +1135,7 @@ mod tests { #[test] fn test_weak_count() { - let a = Arc::new(0u32); + let a = Arc::new(0); assert!(Arc::strong_count(&a) == 1); assert!(Arc::weak_count(&a) == 0); let w = Arc::downgrade(&a); @@ -1161,7 +1161,7 @@ mod tests { #[test] fn show_arc() { - let a = Arc::new(5u32); + let a = Arc::new(5); assert_eq!(format!("{:?}", a), "5"); } diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index dc283f5acdff8..da803f57a59d3 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1014,7 +1014,7 @@ mod tests { #[test] fn test_strong_count() { - let a = Rc::new(0u32); + let a = Rc::new(0); assert!(Rc::strong_count(&a) == 1); let w = Rc::downgrade(&a); assert!(Rc::strong_count(&a) == 1); @@ -1031,7 +1031,7 @@ mod tests { #[test] fn test_weak_count() { - let a = Rc::new(0u32); + let a = Rc::new(0); assert!(Rc::strong_count(&a) == 1); assert!(Rc::weak_count(&a) == 0); let w = Rc::downgrade(&a); From 91a42bedcf251609333acf65761027a4280ba4ca Mon Sep 17 00:00:00 2001 From: srinivasreddy Date: Thu, 10 Mar 2016 22:03:12 +0530 Subject: [PATCH 2/2] removed integer suffixes in libcollections and libcollectionstest --- src/libcollections/linked_list.rs | 16 ++++++++-------- src/libcollectionstest/slice.rs | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index cb669a9bf9ef8..f4a67daf97430 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -1305,10 +1305,10 @@ mod tests { // // https://github.com/rust-lang/rust/issues/26021 let mut v1 = LinkedList::new(); - v1.push_front(1u8); - v1.push_front(1u8); - v1.push_front(1u8); - v1.push_front(1u8); + v1.push_front(1); + v1.push_front(1); + v1.push_front(1); + v1.push_front(1); let _ = v1.split_off(3); // Dropping this now should not cause laundry consumption assert_eq!(v1.len(), 3); @@ -1319,10 +1319,10 @@ mod tests { #[test] fn test_split_off() { let mut v1 = LinkedList::new(); - v1.push_front(1u8); - v1.push_front(1u8); - v1.push_front(1u8); - v1.push_front(1u8); + v1.push_front(1); + v1.push_front(1); + v1.push_front(1); + v1.push_front(1); // test all splits for ix in 0..1 + v1.len() { diff --git a/src/libcollectionstest/slice.rs b/src/libcollectionstest/slice.rs index f3bb58ba45b7e..f286fb1e274a3 100644 --- a/src/libcollectionstest/slice.rs +++ b/src/libcollectionstest/slice.rs @@ -267,9 +267,9 @@ fn test_swap_remove_fail() { fn test_swap_remove_noncopyable() { // Tests that we don't accidentally run destructors twice. let mut v: Vec> = Vec::new(); - v.push(box 0u8); - v.push(box 0u8); - v.push(box 0u8); + v.push(box 0); + v.push(box 0); + v.push(box 0); let mut _e = v.swap_remove(0); assert_eq!(v.len(), 2); _e = v.swap_remove(1); @@ -896,7 +896,7 @@ fn test_overflow_does_not_cause_segfault_managed() { #[test] fn test_mut_split_at() { - let mut values = [1u8,2,3,4,5]; + let mut values = [1,2,3,4,5]; { let (left, right) = values.split_at_mut(2); {