diff options
Diffstat (limited to 'src/libstd/collections')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 34 | ||||
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 6 | ||||
| -rw-r--r-- | src/libstd/collections/lru_cache.rs | 12 |
3 files changed, 26 insertions, 26 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 8f879bd50d0..a8dce232d26 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1548,7 +1548,7 @@ mod test_map { DROP_VECTOR.with(|v| { for i in range(0u, 200) { - assert_eq!(v.borrow().as_slice()[i], 0); + assert_eq!(v.borrow()[i], 0); } }); @@ -1560,7 +1560,7 @@ mod test_map { DROP_VECTOR.with(|v| { for i in range(0u, 200) { - assert_eq!(v.borrow().as_slice()[i], 1); + assert_eq!(v.borrow()[i], 1); } }); @@ -1571,27 +1571,27 @@ mod test_map { assert!(v.is_some()); DROP_VECTOR.with(|v| { - assert_eq!(v.borrow().as_slice()[i], 1); - assert_eq!(v.borrow().as_slice()[i+100], 1); + assert_eq!(v.borrow()[i], 1); + assert_eq!(v.borrow()[i+100], 1); }); } DROP_VECTOR.with(|v| { for i in range(0u, 50) { - assert_eq!(v.borrow().as_slice()[i], 0); - assert_eq!(v.borrow().as_slice()[i+100], 0); + assert_eq!(v.borrow()[i], 0); + assert_eq!(v.borrow()[i+100], 0); } for i in range(50u, 100) { - assert_eq!(v.borrow().as_slice()[i], 1); - assert_eq!(v.borrow().as_slice()[i+100], 1); + assert_eq!(v.borrow()[i], 1); + assert_eq!(v.borrow()[i+100], 1); } }); } DROP_VECTOR.with(|v| { for i in range(0u, 200) { - assert_eq!(v.borrow().as_slice()[i], 0); + assert_eq!(v.borrow()[i], 0); } }); } @@ -1607,7 +1607,7 @@ mod test_map { DROP_VECTOR.with(|v| { for i in range(0u, 200) { - assert_eq!(v.borrow().as_slice()[i], 0); + assert_eq!(v.borrow()[i], 0); } }); @@ -1619,7 +1619,7 @@ mod test_map { DROP_VECTOR.with(|v| { for i in range(0u, 200) { - assert_eq!(v.borrow().as_slice()[i], 1); + assert_eq!(v.borrow()[i], 1); } }); @@ -1634,7 +1634,7 @@ mod test_map { DROP_VECTOR.with(|v| { for i in range(0u, 200) { - assert_eq!(v.borrow().as_slice()[i], 1); + assert_eq!(v.borrow()[i], 1); } }); @@ -1642,11 +1642,11 @@ mod test_map { DROP_VECTOR.with(|v| { let nk = range(0u, 100).filter(|&i| { - v.borrow().as_slice()[i] == 1 + v.borrow()[i] == 1 }).count(); let nv = range(0u, 100).filter(|&i| { - v.borrow().as_slice()[i+100] == 1 + v.borrow()[i+100] == 1 }).count(); assert_eq!(nk, 50); @@ -1656,7 +1656,7 @@ mod test_map { DROP_VECTOR.with(|v| { for i in range(0u, 200) { - assert_eq!(v.borrow().as_slice()[i], 0); + assert_eq!(v.borrow()[i], 0); } }); } @@ -1905,8 +1905,8 @@ mod test_map { let map_str = format!("{}", map); - assert!(map_str == "{1: 2, 3: 4}".to_string() || map_str == "{3: 4, 1: 2}".to_string()); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert!(map_str == "{1: 2, 3: 4}" || map_str == "{3: 4, 1: 2}"); + assert_eq!(format!("{}", empty), "{}"); } #[test] diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index fd32d207e79..b3ccfdbb47c 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -827,7 +827,7 @@ mod test_set { }; let v = hs.into_iter().collect::<Vec<char>>(); - assert!(['a', 'b'][] == v.as_slice() || ['b', 'a'][] == v.as_slice()); + assert!(['a', 'b'] == v || ['b', 'a'] == v); } #[test] @@ -862,7 +862,7 @@ mod test_set { let set_str = format!("{}", set); - assert!(set_str == "{1, 2}".to_string() || set_str == "{2, 1}".to_string()); - assert_eq!(format!("{}", empty), "{}".to_string()); + assert!(set_str == "{1, 2}" || set_str == "{2, 1}"); + assert_eq!(format!("{}", empty), "{}"); } } diff --git a/src/libstd/collections/lru_cache.rs b/src/libstd/collections/lru_cache.rs index adbc135364b..6caa2f7b4da 100644 --- a/src/libstd/collections/lru_cache.rs +++ b/src/libstd/collections/lru_cache.rs @@ -447,15 +447,15 @@ mod tests { cache.insert(1, 10); cache.insert(2, 20); cache.insert(3, 30); - assert_eq!(cache.to_string(), "{3: 30, 2: 20, 1: 10}".to_string()); + assert_eq!(cache.to_string(), "{3: 30, 2: 20, 1: 10}"); cache.insert(2, 22); - assert_eq!(cache.to_string(), "{2: 22, 3: 30, 1: 10}".to_string()); + assert_eq!(cache.to_string(), "{2: 22, 3: 30, 1: 10}"); cache.insert(6, 60); - assert_eq!(cache.to_string(), "{6: 60, 2: 22, 3: 30}".to_string()); + assert_eq!(cache.to_string(), "{6: 60, 2: 22, 3: 30}"); cache.get(&3); - assert_eq!(cache.to_string(), "{3: 30, 6: 60, 2: 22}".to_string()); + assert_eq!(cache.to_string(), "{3: 30, 6: 60, 2: 22}"); cache.set_capacity(2); - assert_eq!(cache.to_string(), "{3: 30, 6: 60}".to_string()); + assert_eq!(cache.to_string(), "{3: 30, 6: 60}"); } #[test] @@ -466,6 +466,6 @@ mod tests { cache.clear(); assert!(cache.get(&1).is_none()); assert!(cache.get(&2).is_none()); - assert_eq!(cache.to_string(), "{}".to_string()); + assert_eq!(cache.to_string(), "{}"); } } |
