diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-11-27 19:09:59 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-06 23:53:02 -0500 |
| commit | 98ae63753bc6c2efe1c8ed50d45e665db686cde7 (patch) | |
| tree | 0a9aced79cc16baba1fb00e83cabf00a4550e43f /src | |
| parent | 976660f3f73a2dba68695fce1b697f7694af0a23 (diff) | |
| download | rust-98ae63753bc6c2efe1c8ed50d45e665db686cde7.tar.gz rust-98ae63753bc6c2efe1c8ed50d45e665db686cde7.zip | |
libcollections: remove unnecessary `to_string()` calls
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcollections/bit.rs | 2 | ||||
| -rw-r--r-- | src/libcollections/btree/set.rs | 4 | ||||
| -rw-r--r-- | src/libcollections/slice.rs | 16 | ||||
| -rw-r--r-- | src/libcollections/str.rs | 8 | ||||
| -rw-r--r-- | src/libcollections/string.rs | 24 | ||||
| -rw-r--r-- | src/libcollections/tree/map.rs | 4 | ||||
| -rw-r--r-- | src/libcollections/tree/set.rs | 4 | ||||
| -rw-r--r-- | src/libcollections/trie/map.rs | 4 | ||||
| -rw-r--r-- | src/libcollections/trie/set.rs | 4 | ||||
| -rw-r--r-- | src/libcollections/vec_map.rs | 2 |
10 files changed, 36 insertions, 36 deletions
diff --git a/src/libcollections/bit.rs b/src/libcollections/bit.rs index 953e432fd4a..ad5732c47a8 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 64ae4f6a508..bacbe98ad61 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 9417cc3e594..03b8ea8f20f 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -1838,20 +1838,20 @@ mod tests { }) ) let empty: Vec<int> = 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 6e26962950b..0c41a850ac3 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::<String>(), $expected.into_string()); + assert_eq!($input.nfd_chars().collect::<String>(), $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::<String>(), $expected.into_string()); + assert_eq!($input.nfkd_chars().collect::<String>(), $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::<String>(), $expected.into_string()); + assert_eq!($input.nfc_chars().collect::<String>(), $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::<String>(), $expected.into_string()); + assert_eq!($input.nfkc_chars().collect::<String>(), $expected); } } t!("abc", "abc"); diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index a7545d06960..571f3fa4685 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<int> = 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 119268c27ee..3818be5a197 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 6988b929df6..bdb33f70499 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 672ddab4d87..6491c9a569d 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 1b3657943da..436da511742 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 3be662c071c..97b80108d76 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] |
