diff --git a/src/libcollections/bit.rs b/src/libcollections/bit.rs index 953e432fd4a7..ad5732c47a89 100644 --- a/src/libcollections/bit.rs +++ b/src/libcollections/bit.rs @@ -2660,7 +2660,7 @@ mod tests { s.insert(10); s.insert(50); s.insert(2); - assert_eq!("{1, 2, 10, 50}".to_string(), s.to_string()); + assert_eq!("{1, 2, 10, 50}", s.to_string()); } fn rng() -> rand::IsaacRng { diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index 64ae4f6a5086..bacbe98ad612 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -580,7 +580,7 @@ mod test { let set_str = format!("{}", set); - assert!(set_str == "{1, 2}".to_string()); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert!(set_str == "{1, 2}"); + assert_eq!(format!("{}", empty), "{}"); } } diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 9417cc3e5947..03b8ea8f20fa 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -1838,20 +1838,20 @@ mod tests { }) ) let empty: Vec = vec![]; - test_show_vec!(empty, "[]".to_string()); - test_show_vec!(vec![1i], "[1]".to_string()); - test_show_vec!(vec![1i, 2, 3], "[1, 2, 3]".to_string()); + test_show_vec!(empty, "[]"); + test_show_vec!(vec![1i], "[1]"); + test_show_vec!(vec![1i, 2, 3], "[1, 2, 3]"); test_show_vec!(vec![vec![], vec![1u], vec![1u, 1u]], - "[[], [1], [1, 1]]".to_string()); + "[[], [1], [1, 1]]"); let empty_mut: &mut [int] = &mut[]; - test_show_vec!(empty_mut, "[]".to_string()); + test_show_vec!(empty_mut, "[]"); let v: &mut[int] = &mut[1]; - test_show_vec!(v, "[1]".to_string()); + test_show_vec!(v, "[1]"); let v: &mut[int] = &mut[1, 2, 3]; - test_show_vec!(v, "[1, 2, 3]".to_string()); + test_show_vec!(v, "[1, 2, 3]"); let v: &mut [&mut[uint]] = &mut[&mut[], &mut[1u], &mut[1u, 1u]]; - test_show_vec!(v, "[[], [1], [1, 1]]".to_string()); + test_show_vec!(v, "[[], [1], [1, 1]]"); } #[test] diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 6e26962950ba..0c41a850ac3f 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -1831,7 +1831,7 @@ mod tests { fn test_nfd_chars() { macro_rules! t { ($input: expr, $expected: expr) => { - assert_eq!($input.nfd_chars().collect::(), $expected.into_string()); + assert_eq!($input.nfd_chars().collect::(), $expected); } } t!("abc", "abc"); @@ -1850,7 +1850,7 @@ mod tests { fn test_nfkd_chars() { macro_rules! t { ($input: expr, $expected: expr) => { - assert_eq!($input.nfkd_chars().collect::(), $expected.into_string()); + assert_eq!($input.nfkd_chars().collect::(), $expected); } } t!("abc", "abc"); @@ -1869,7 +1869,7 @@ mod tests { fn test_nfc_chars() { macro_rules! t { ($input: expr, $expected: expr) => { - assert_eq!($input.nfc_chars().collect::(), $expected.into_string()); + assert_eq!($input.nfc_chars().collect::(), $expected); } } t!("abc", "abc"); @@ -1889,7 +1889,7 @@ mod tests { fn test_nfkc_chars() { macro_rules! t { ($input: expr, $expected: expr) => { - assert_eq!($input.nfkc_chars().collect::(), $expected.into_string()); + assert_eq!($input.nfkc_chars().collect::(), $expected); } } t!("abc", "abc"); diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index a7545d069602..571f3fa46858 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1287,24 +1287,24 @@ mod tests { #[test] fn test_simple_types() { - assert_eq!(1i.to_string(), "1".to_string()); - assert_eq!((-1i).to_string(), "-1".to_string()); - assert_eq!(200u.to_string(), "200".to_string()); - assert_eq!(2u8.to_string(), "2".to_string()); - assert_eq!(true.to_string(), "true".to_string()); - assert_eq!(false.to_string(), "false".to_string()); - assert_eq!(().to_string(), "()".to_string()); - assert_eq!(("hi".to_string()).to_string(), "hi".to_string()); + assert_eq!(1i.to_string(), "1"); + assert_eq!((-1i).to_string(), "-1"); + assert_eq!(200u.to_string(), "200"); + assert_eq!(2u8.to_string(), "2"); + assert_eq!(true.to_string(), "true"); + assert_eq!(false.to_string(), "false"); + assert_eq!(().to_string(), "()"); + assert_eq!(("hi".to_string()).to_string(), "hi"); } #[test] fn test_vectors() { let x: Vec = vec![]; - assert_eq!(x.to_string(), "[]".to_string()); - assert_eq!((vec![1i]).to_string(), "[1]".to_string()); - assert_eq!((vec![1i, 2, 3]).to_string(), "[1, 2, 3]".to_string()); + assert_eq!(x.to_string(), "[]"); + assert_eq!((vec![1i]).to_string(), "[1]"); + assert_eq!((vec![1i, 2, 3]).to_string(), "[1, 2, 3]"); assert!((vec![vec![], vec![1i], vec![1i, 1]]).to_string() == - "[[], [1], [1, 1]]".to_string()); + "[[], [1], [1, 1]]"); } #[bench] diff --git a/src/libcollections/tree/map.rs b/src/libcollections/tree/map.rs index 119268c27eea..3818be5a1979 100644 --- a/src/libcollections/tree/map.rs +++ b/src/libcollections/tree/map.rs @@ -1735,8 +1735,8 @@ mod test_treemap { let map_str = format!("{}", map); - assert!(map_str == "{1: 2, 3: 4}".to_string()); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert!(map_str == "{1: 2, 3: 4}"); + assert_eq!(format!("{}", empty), "{}"); } #[test] diff --git a/src/libcollections/tree/set.rs b/src/libcollections/tree/set.rs index 6988b929df68..bdb33f704991 100644 --- a/src/libcollections/tree/set.rs +++ b/src/libcollections/tree/set.rs @@ -979,7 +979,7 @@ mod test { let set_str = format!("{}", set); - assert!(set_str == "{1, 2}".to_string()); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert!(set_str == "{1, 2}"); + assert_eq!(format!("{}", empty), "{}"); } } diff --git a/src/libcollections/trie/map.rs b/src/libcollections/trie/map.rs index 672ddab4d87e..6491c9a569dc 100644 --- a/src/libcollections/trie/map.rs +++ b/src/libcollections/trie/map.rs @@ -1605,8 +1605,8 @@ mod test { let map_str = format!("{}", map); - assert!(map_str == "{1: a, 2: b}".to_string()); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert!(map_str == "{1: a, 2: b}"); + assert_eq!(format!("{}", empty), "{}"); } #[test] diff --git a/src/libcollections/trie/set.rs b/src/libcollections/trie/set.rs index 1b3657943da6..436da5117428 100644 --- a/src/libcollections/trie/set.rs +++ b/src/libcollections/trie/set.rs @@ -696,8 +696,8 @@ mod test { let set_str = format!("{}", set); - assert!(set_str == "{1, 2}".to_string()); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert!(set_str == "{1, 2}"); + assert_eq!(format!("{}", empty), "{}"); } #[test] diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs index 3be662c071c1..97b80108d766 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -871,7 +871,7 @@ mod test_map { let map_str = map.to_string(); assert!(map_str == "{1: 2, 3: 4}" || map_str == "{3: 4, 1: 2}"); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert_eq!(format!("{}", empty), "{}"); } #[test]