about summary refs log tree commit diff
path: root/src/libstd/collections
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2015-01-25 22:05:03 +0100
committerTobias Bucher <tobiasbucher5991@gmail.com>2015-01-30 04:38:54 +0100
commit7f64fe4e27555c256cb228feb05d4181a2287125 (patch)
treec1fd374d345905c7c4c9b1e7df160d3394edbec5 /src/libstd/collections
parent52c74e63dacd49017b19330e0cbecbac0a3fe62e (diff)
downloadrust-7f64fe4e27555c256cb228feb05d4181a2287125.tar.gz
rust-7f64fe4e27555c256cb228feb05d4181a2287125.zip
Remove all `i` suffixes
Diffstat (limited to 'src/libstd/collections')
-rw-r--r--src/libstd/collections/hash/bench.rs20
-rw-r--r--src/libstd/collections/hash/map.rs94
-rw-r--r--src/libstd/collections/hash/set.rs62
-rw-r--r--src/libstd/collections/hash/table.rs2
4 files changed, 89 insertions, 89 deletions
diff --git a/src/libstd/collections/hash/bench.rs b/src/libstd/collections/hash/bench.rs
index 28689767cb0..ce02648b8f2 100644
--- a/src/libstd/collections/hash/bench.rs
+++ b/src/libstd/collections/hash/bench.rs
@@ -32,7 +32,7 @@ fn new_insert_drop(b : &mut Bencher) {
 
     b.iter(|| {
         let mut m = HashMap::new();
-        m.insert(0i, 0i);
+        m.insert(0, 0);
         assert_eq!(m.len(), 1);
     })
 }
@@ -43,7 +43,7 @@ fn grow_by_insertion(b: &mut Bencher) {
 
     let mut m = HashMap::new();
 
-    for i in range_inclusive(1i, 1000) {
+    for i in range_inclusive(1, 1000) {
         m.insert(i, i);
     }
 
@@ -61,12 +61,12 @@ fn find_existing(b: &mut Bencher) {
 
     let mut m = HashMap::new();
 
-    for i in range_inclusive(1i, 1000) {
+    for i in range_inclusive(1, 1000) {
         m.insert(i, i);
     }
 
     b.iter(|| {
-        for i in range_inclusive(1i, 1000) {
+        for i in range_inclusive(1, 1000) {
             m.contains_key(&i);
         }
     });
@@ -78,12 +78,12 @@ fn find_nonexisting(b: &mut Bencher) {
 
     let mut m = HashMap::new();
 
-    for i in range_inclusive(1i, 1000) {
+    for i in range_inclusive(1, 1000) {
         m.insert(i, i);
     }
 
     b.iter(|| {
-        for i in range_inclusive(1001i, 2000) {
+        for i in range_inclusive(1001, 2000) {
             m.contains_key(&i);
         }
     });
@@ -95,11 +95,11 @@ fn hashmap_as_queue(b: &mut Bencher) {
 
     let mut m = HashMap::new();
 
-    for i in range_inclusive(1i, 1000) {
+    for i in range_inclusive(1, 1000) {
         m.insert(i, i);
     }
 
-    let mut k = 1i;
+    let mut k = 1;
 
     b.iter(|| {
         m.remove(&k);
@@ -114,11 +114,11 @@ fn get_remove_insert(b: &mut Bencher) {
 
     let mut m = HashMap::new();
 
-    for i in range_inclusive(1i, 1000) {
+    for i in range_inclusive(1, 1000) {
         m.insert(i, i);
     }
 
-    let mut k = 1i;
+    let mut k = 1;
 
     b.iter(|| {
         m.get(&(k + 400));
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index a291ec16a62..0b81e119821 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -536,7 +536,7 @@ impl<K, V, S, H> HashMap<K, V, S>
     ///
     /// let s = RandomState::new();
     /// let mut map = HashMap::with_hash_state(s);
-    /// map.insert(1i, 2u);
+    /// map.insert(1, 2u);
     /// ```
     #[inline]
     #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")]
@@ -564,7 +564,7 @@ impl<K, V, S, H> HashMap<K, V, S>
     ///
     /// let s = RandomState::new();
     /// let mut map = HashMap::with_capacity_and_hash_state(10, s);
-    /// map.insert(1i, 2u);
+    /// map.insert(1, 2u);
     /// ```
     #[inline]
     #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")]
@@ -809,7 +809,7 @@ impl<K, V, S, H> HashMap<K, V, S>
     /// use std::collections::HashMap;
     ///
     /// let mut map = HashMap::new();
-    /// map.insert("a", 1i);
+    /// map.insert("a", 1);
     /// map.insert("b", 2);
     /// map.insert("c", 3);
     ///
@@ -834,7 +834,7 @@ impl<K, V, S, H> HashMap<K, V, S>
     /// use std::collections::HashMap;
     ///
     /// let mut map = HashMap::new();
-    /// map.insert("a", 1i);
+    /// map.insert("a", 1);
     /// map.insert("b", 2);
     /// map.insert("c", 3);
     ///
@@ -859,7 +859,7 @@ impl<K, V, S, H> HashMap<K, V, S>
     /// use std::collections::HashMap;
     ///
     /// let mut map = HashMap::new();
-    /// map.insert("a", 1i);
+    /// map.insert("a", 1);
     /// map.insert("b", 2);
     /// map.insert("c", 3);
     ///
@@ -882,7 +882,7 @@ impl<K, V, S, H> HashMap<K, V, S>
     /// use std::collections::HashMap;
     ///
     /// let mut map = HashMap::new();
-    /// map.insert("a", 1i);
+    /// map.insert("a", 1);
     /// map.insert("b", 2);
     /// map.insert("c", 3);
     ///
@@ -910,7 +910,7 @@ impl<K, V, S, H> HashMap<K, V, S>
     /// use std::collections::HashMap;
     ///
     /// let mut map = HashMap::new();
-    /// map.insert("a", 1i);
+    /// map.insert("a", 1);
     /// map.insert("b", 2);
     /// map.insert("c", 3);
     ///
@@ -1622,7 +1622,7 @@ mod test_map {
     fn test_create_capacity_zero() {
         let mut m = HashMap::with_capacity(0);
 
-        assert!(m.insert(1i, 1i).is_none());
+        assert!(m.insert(1, 1).is_none());
 
         assert!(m.contains_key(&1));
         assert!(!m.contains_key(&0));
@@ -1632,9 +1632,9 @@ mod test_map {
     fn test_insert() {
         let mut m = HashMap::new();
         assert_eq!(m.len(), 0);
-        assert!(m.insert(1i, 2i).is_none());
+        assert!(m.insert(1, 2).is_none());
         assert_eq!(m.len(), 1);
-        assert!(m.insert(2i, 4i).is_none());
+        assert!(m.insert(2, 4).is_none());
         assert_eq!(m.len(), 2);
         assert_eq!(*m.get(&1).unwrap(), 2);
         assert_eq!(*m.get(&2).unwrap(), 4);
@@ -1674,7 +1674,7 @@ mod test_map {
     #[test]
     fn test_drops() {
         DROP_VECTOR.with(|slot| {
-            *slot.borrow_mut() = repeat(0i).take(200).collect();
+            *slot.borrow_mut() = repeat(0).take(200).collect();
         });
 
         {
@@ -1807,10 +1807,10 @@ mod test_map {
 
         // Try this a few times to make sure we never screw up the hashmap's
         // internal state.
-        for _ in 0i..10 {
+        for _ in 0..10 {
             assert!(m.is_empty());
 
-            for i in range_inclusive(1i, 1000) {
+            for i in range_inclusive(1, 1000) {
                 assert!(m.insert(i, i).is_none());
 
                 for j in range_inclusive(1, i) {
@@ -1824,12 +1824,12 @@ mod test_map {
                 }
             }
 
-            for i in range_inclusive(1001i, 2000) {
+            for i in range_inclusive(1001, 2000) {
                 assert!(!m.contains_key(&i));
             }
 
             // remove forwards
-            for i in range_inclusive(1i, 1000) {
+            for i in range_inclusive(1, 1000) {
                 assert!(m.remove(&i).is_some());
 
                 for j in range_inclusive(1, i) {
@@ -1841,16 +1841,16 @@ mod test_map {
                 }
             }
 
-            for i in range_inclusive(1i, 1000) {
+            for i in range_inclusive(1, 1000) {
                 assert!(!m.contains_key(&i));
             }
 
-            for i in range_inclusive(1i, 1000) {
+            for i in range_inclusive(1, 1000) {
                 assert!(m.insert(i, i).is_none());
             }
 
             // remove backwards
-            for i in range_step_inclusive(1000i, 1, -1) {
+            for i in range_step_inclusive(1000, 1, -1) {
                 assert!(m.remove(&i).is_some());
 
                 for j in range_inclusive(i, 1000) {
@@ -1867,9 +1867,9 @@ mod test_map {
     #[test]
     fn test_find_mut() {
         let mut m = HashMap::new();
-        assert!(m.insert(1i, 12i).is_none());
-        assert!(m.insert(2i, 8i).is_none());
-        assert!(m.insert(5i, 14i).is_none());
+        assert!(m.insert(1, 12).is_none());
+        assert!(m.insert(2, 8).is_none());
+        assert!(m.insert(5, 14).is_none());
         let new = 100;
         match m.get_mut(&5) {
             None => panic!(), Some(x) => *x = new
@@ -1880,18 +1880,18 @@ mod test_map {
     #[test]
     fn test_insert_overwrite() {
         let mut m = HashMap::new();
-        assert!(m.insert(1i, 2i).is_none());
+        assert!(m.insert(1, 2).is_none());
         assert_eq!(*m.get(&1).unwrap(), 2);
-        assert!(!m.insert(1i, 3i).is_none());
+        assert!(!m.insert(1, 3).is_none());
         assert_eq!(*m.get(&1).unwrap(), 3);
     }
 
     #[test]
     fn test_insert_conflicts() {
         let mut m = HashMap::with_capacity(4);
-        assert!(m.insert(1i, 2i).is_none());
-        assert!(m.insert(5i, 3i).is_none());
-        assert!(m.insert(9i, 4i).is_none());
+        assert!(m.insert(1, 2).is_none());
+        assert!(m.insert(5, 3).is_none());
+        assert!(m.insert(9, 4).is_none());
         assert_eq!(*m.get(&9).unwrap(), 4);
         assert_eq!(*m.get(&5).unwrap(), 3);
         assert_eq!(*m.get(&1).unwrap(), 2);
@@ -1900,7 +1900,7 @@ mod test_map {
     #[test]
     fn test_conflict_remove() {
         let mut m = HashMap::with_capacity(4);
-        assert!(m.insert(1i, 2i).is_none());
+        assert!(m.insert(1, 2).is_none());
         assert_eq!(*m.get(&1).unwrap(), 2);
         assert!(m.insert(5, 3).is_none());
         assert_eq!(*m.get(&1).unwrap(), 2);
@@ -1917,7 +1917,7 @@ mod test_map {
     #[test]
     fn test_is_empty() {
         let mut m = HashMap::with_capacity(4);
-        assert!(m.insert(1i, 2i).is_none());
+        assert!(m.insert(1, 2).is_none());
         assert!(!m.is_empty());
         assert!(m.remove(&1).is_some());
         assert!(m.is_empty());
@@ -1926,7 +1926,7 @@ mod test_map {
     #[test]
     fn test_pop() {
         let mut m = HashMap::new();
-        m.insert(1i, 2i);
+        m.insert(1, 2);
         assert_eq!(m.remove(&1), Some(2));
         assert_eq!(m.remove(&1), None);
     }
@@ -1950,7 +1950,7 @@ mod test_map {
 
     #[test]
     fn test_keys() {
-        let vec = vec![(1i, 'a'), (2i, 'b'), (3i, 'c')];
+        let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')];
         let map = vec.into_iter().collect::<HashMap<int, char>>();
         let keys = map.keys().map(|&k| k).collect::<Vec<int>>();
         assert_eq!(keys.len(), 3);
@@ -1961,7 +1961,7 @@ mod test_map {
 
     #[test]
     fn test_values() {
-        let vec = vec![(1i, 'a'), (2i, 'b'), (3i, 'c')];
+        let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')];
         let map = vec.into_iter().collect::<HashMap<int, char>>();
         let values = map.values().map(|&v| v).collect::<Vec<char>>();
         assert_eq!(values.len(), 3);
@@ -1973,8 +1973,8 @@ mod test_map {
     #[test]
     fn test_find() {
         let mut m = HashMap::new();
-        assert!(m.get(&1i).is_none());
-        m.insert(1i, 2i);
+        assert!(m.get(&1).is_none());
+        m.insert(1, 2);
         match m.get(&1) {
             None => panic!(),
             Some(v) => assert_eq!(*v, 2)
@@ -1984,17 +1984,17 @@ mod test_map {
     #[test]
     fn test_eq() {
         let mut m1 = HashMap::new();
-        m1.insert(1i, 2i);
-        m1.insert(2i, 3i);
-        m1.insert(3i, 4i);
+        m1.insert(1, 2);
+        m1.insert(2, 3);
+        m1.insert(3, 4);
 
         let mut m2 = HashMap::new();
-        m2.insert(1i, 2i);
-        m2.insert(2i, 3i);
+        m2.insert(1, 2);
+        m2.insert(2, 3);
 
         assert!(m1 != m2);
 
-        m2.insert(3i, 4i);
+        m2.insert(3, 4);
 
         assert_eq!(m1, m2);
     }
@@ -2004,8 +2004,8 @@ mod test_map {
         let mut map: HashMap<int, int> = HashMap::new();
         let empty: HashMap<int, int> = HashMap::new();
 
-        map.insert(1i, 2i);
-        map.insert(3i, 4i);
+        map.insert(1, 2);
+        map.insert(3, 4);
 
         let map_str = format!("{:?}", map);
 
@@ -2127,7 +2127,7 @@ mod test_map {
 
     #[test]
     fn test_from_iter() {
-        let xs = [(1i, 1i), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
+        let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
 
         let map: HashMap<int, int> = xs.iter().map(|&x| x).collect();
 
@@ -2138,7 +2138,7 @@ mod test_map {
 
     #[test]
     fn test_size_hint() {
-        let xs = [(1i, 1i), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
+        let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
 
         let map: HashMap<int, int> = xs.iter().map(|&x| x).collect();
 
@@ -2151,7 +2151,7 @@ mod test_map {
 
     #[test]
     fn test_iter_len() {
-        let xs = [(1i, 1i), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
+        let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
 
         let map: HashMap<int, int> = xs.iter().map(|&x| x).collect();
 
@@ -2164,7 +2164,7 @@ mod test_map {
 
     #[test]
     fn test_mut_size_hint() {
-        let xs = [(1i, 1i), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
+        let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
 
         let mut map: HashMap<int, int> = xs.iter().map(|&x| x).collect();
 
@@ -2177,7 +2177,7 @@ mod test_map {
 
     #[test]
     fn test_iter_mut_len() {
-        let xs = [(1i, 1i), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
+        let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
 
         let mut map: HashMap<int, int> = xs.iter().map(|&x| x).collect();
 
@@ -2213,7 +2213,7 @@ mod test_map {
 
     #[test]
     fn test_entry(){
-        let xs = [(1i, 10i), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)];
+        let xs = [(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)];
 
         let mut map: HashMap<int, int> = xs.iter().map(|&x| x).collect();
 
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs
index 2b15e50c6fa..3095c2c0e41 100644
--- a/src/libstd/collections/hash/set.rs
+++ b/src/libstd/collections/hash/set.rs
@@ -168,7 +168,7 @@ impl<T, S, H> HashSet<T, S>
     ///
     /// let s = RandomState::new();
     /// let mut set = HashSet::with_capacity_and_hash_state(10u, s);
-    /// set.insert(1i);
+    /// set.insert(1);
     /// ```
     #[inline]
     #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")]
@@ -290,8 +290,8 @@ impl<T, S, H> HashSet<T, S>
     ///
     /// ```
     /// use std::collections::HashSet;
-    /// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
-    /// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
+    /// let a: HashSet<int> = [1, 2, 3].iter().map(|&x| x).collect();
+    /// let b: HashSet<int> = [4, 2, 3, 4].iter().map(|&x| x).collect();
     ///
     /// // Can be seen as `a - b`.
     /// for x in a.difference(&b) {
@@ -299,12 +299,12 @@ impl<T, S, H> HashSet<T, S>
     /// }
     ///
     /// let diff: HashSet<int> = a.difference(&b).map(|&x| x).collect();
-    /// assert_eq!(diff, [1i].iter().map(|&x| x).collect());
+    /// assert_eq!(diff, [1].iter().map(|&x| x).collect());
     ///
     /// // Note that difference is not symmetric,
     /// // and `b - a` means something else:
     /// let diff: HashSet<int> = b.difference(&a).map(|&x| x).collect();
-    /// assert_eq!(diff, [4i].iter().map(|&x| x).collect());
+    /// assert_eq!(diff, [4].iter().map(|&x| x).collect());
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S> {
@@ -320,8 +320,8 @@ impl<T, S, H> HashSet<T, S>
     ///
     /// ```
     /// use std::collections::HashSet;
-    /// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
-    /// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
+    /// let a: HashSet<int> = [1, 2, 3].iter().map(|&x| x).collect();
+    /// let b: HashSet<int> = [4, 2, 3, 4].iter().map(|&x| x).collect();
     ///
     /// // Print 1, 4 in arbitrary order.
     /// for x in a.symmetric_difference(&b) {
@@ -332,7 +332,7 @@ impl<T, S, H> HashSet<T, S>
     /// let diff2: HashSet<int> = b.symmetric_difference(&a).map(|&x| x).collect();
     ///
     /// assert_eq!(diff1, diff2);
-    /// assert_eq!(diff1, [1i, 4].iter().map(|&x| x).collect());
+    /// assert_eq!(diff1, [1, 4].iter().map(|&x| x).collect());
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn symmetric_difference<'a>(&'a self, other: &'a HashSet<T, S>)
@@ -346,8 +346,8 @@ impl<T, S, H> HashSet<T, S>
     ///
     /// ```
     /// use std::collections::HashSet;
-    /// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
-    /// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
+    /// let a: HashSet<int> = [1, 2, 3].iter().map(|&x| x).collect();
+    /// let b: HashSet<int> = [4, 2, 3, 4].iter().map(|&x| x).collect();
     ///
     /// // Print 2, 3 in arbitrary order.
     /// for x in a.intersection(&b) {
@@ -355,7 +355,7 @@ impl<T, S, H> HashSet<T, S>
     /// }
     ///
     /// let diff: HashSet<int> = a.intersection(&b).map(|&x| x).collect();
-    /// assert_eq!(diff, [2i, 3].iter().map(|&x| x).collect());
+    /// assert_eq!(diff, [2, 3].iter().map(|&x| x).collect());
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S> {
@@ -371,8 +371,8 @@ impl<T, S, H> HashSet<T, S>
     ///
     /// ```
     /// use std::collections::HashSet;
-    /// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
-    /// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
+    /// let a: HashSet<int> = [1, 2, 3].iter().map(|&x| x).collect();
+    /// let b: HashSet<int> = [4, 2, 3, 4].iter().map(|&x| x).collect();
     ///
     /// // Print 1, 2, 3, 4 in arbitrary order.
     /// for x in a.union(&b) {
@@ -380,7 +380,7 @@ impl<T, S, H> HashSet<T, S>
     /// }
     ///
     /// let diff: HashSet<int> = a.union(&b).map(|&x| x).collect();
-    /// assert_eq!(diff, [1i, 2, 3, 4].iter().map(|&x| x).collect());
+    /// assert_eq!(diff, [1, 2, 3, 4].iter().map(|&x| x).collect());
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> {
@@ -955,8 +955,8 @@ mod test_set {
         let mut ys = HashSet::new();
         assert!(xs.is_disjoint(&ys));
         assert!(ys.is_disjoint(&xs));
-        assert!(xs.insert(5i));
-        assert!(ys.insert(11i));
+        assert!(xs.insert(5));
+        assert!(ys.insert(11));
         assert!(xs.is_disjoint(&ys));
         assert!(ys.is_disjoint(&xs));
         assert!(xs.insert(7));
@@ -974,13 +974,13 @@ mod test_set {
     #[test]
     fn test_subset_and_superset() {
         let mut a = HashSet::new();
-        assert!(a.insert(0i));
+        assert!(a.insert(0));
         assert!(a.insert(5));
         assert!(a.insert(11));
         assert!(a.insert(7));
 
         let mut b = HashSet::new();
-        assert!(b.insert(0i));
+        assert!(b.insert(0));
         assert!(b.insert(7));
         assert!(b.insert(19));
         assert!(b.insert(250));
@@ -1018,7 +1018,7 @@ mod test_set {
         let mut a = HashSet::new();
         let mut b = HashSet::new();
 
-        assert!(a.insert(11i));
+        assert!(a.insert(11));
         assert!(a.insert(1));
         assert!(a.insert(3));
         assert!(a.insert(77));
@@ -1026,7 +1026,7 @@ mod test_set {
         assert!(a.insert(5));
         assert!(a.insert(-5));
 
-        assert!(b.insert(2i));
+        assert!(b.insert(2));
         assert!(b.insert(11));
         assert!(b.insert(77));
         assert!(b.insert(-9));
@@ -1048,13 +1048,13 @@ mod test_set {
         let mut a = HashSet::new();
         let mut b = HashSet::new();
 
-        assert!(a.insert(1i));
+        assert!(a.insert(1));
         assert!(a.insert(3));
         assert!(a.insert(5));
         assert!(a.insert(9));
         assert!(a.insert(11));
 
-        assert!(b.insert(3i));
+        assert!(b.insert(3));
         assert!(b.insert(9));
 
         let mut i = 0;
@@ -1071,13 +1071,13 @@ mod test_set {
         let mut a = HashSet::new();
         let mut b = HashSet::new();
 
-        assert!(a.insert(1i));
+        assert!(a.insert(1));
         assert!(a.insert(3));
         assert!(a.insert(5));
         assert!(a.insert(9));
         assert!(a.insert(11));
 
-        assert!(b.insert(-2i));
+        assert!(b.insert(-2));
         assert!(b.insert(3));
         assert!(b.insert(9));
         assert!(b.insert(14));
@@ -1097,7 +1097,7 @@ mod test_set {
         let mut a = HashSet::new();
         let mut b = HashSet::new();
 
-        assert!(a.insert(1i));
+        assert!(a.insert(1));
         assert!(a.insert(3));
         assert!(a.insert(5));
         assert!(a.insert(9));
@@ -1106,7 +1106,7 @@ mod test_set {
         assert!(a.insert(19));
         assert!(a.insert(24));
 
-        assert!(b.insert(-2i));
+        assert!(b.insert(-2));
         assert!(b.insert(1));
         assert!(b.insert(5));
         assert!(b.insert(9));
@@ -1124,7 +1124,7 @@ mod test_set {
 
     #[test]
     fn test_from_iter() {
-        let xs = [1i, 2, 3, 4, 5, 6, 7, 8, 9];
+        let xs = [1, 2, 3, 4, 5, 6, 7, 8, 9];
 
         let set: HashSet<int> = xs.iter().map(|&x| x).collect();
 
@@ -1154,13 +1154,13 @@ mod test_set {
         // I'm keeping them around to prevent a regression.
         let mut s1 = HashSet::new();
 
-        s1.insert(1i);
+        s1.insert(1);
         s1.insert(2);
         s1.insert(3);
 
         let mut s2 = HashSet::new();
 
-        s2.insert(1i);
+        s2.insert(1);
         s2.insert(2);
 
         assert!(s1 != s2);
@@ -1175,7 +1175,7 @@ mod test_set {
         let mut set: HashSet<int> = HashSet::new();
         let empty: HashSet<int> = HashSet::new();
 
-        set.insert(1i);
+        set.insert(1);
         set.insert(2);
 
         let set_str = format!("{:?}", set);
@@ -1201,7 +1201,7 @@ mod test_set {
         let mut s: HashSet<int> = (1is..100).collect();
 
         // try this a bunch of times to make sure we don't screw up internal state.
-        for _ in 0i..20 {
+        for _ in 0..20 {
             assert_eq!(s.len(), 99);
 
             {
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs
index 9e6a45d8bf0..429923890ef 100644
--- a/src/libstd/collections/hash/table.rs
+++ b/src/libstd/collections/hash/table.rs
@@ -274,7 +274,7 @@ impl<K, V, M: Deref<Target=RawTable<K, V>>> Bucket<K, V, M> {
         // ... and it's zero at all other times.
         let maybe_wraparound_dist = (self.idx ^ (self.idx + 1)) & self.table.capacity();
         // Finally, we obtain the offset 1 or the offset -cap + 1.
-        let dist = 1i - (maybe_wraparound_dist as int);
+        let dist = 1 - (maybe_wraparound_dist as int);
 
         self.idx += 1;