@@ -620,7 +620,7 @@ impl<K: Hash + Eq, V> HashMap<K, V, RandomState> {
620
620
///
621
621
/// ```
622
622
/// use std::collections::HashMap;
623
- /// let mut map: HashMap<&str, isize > = HashMap::new();
623
+ /// let mut map: HashMap<&str, i32 > = HashMap::new();
624
624
/// ```
625
625
#[ inline]
626
626
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -637,7 +637,7 @@ impl<K: Hash + Eq, V> HashMap<K, V, RandomState> {
637
637
///
638
638
/// ```
639
639
/// use std::collections::HashMap;
640
- /// let mut map: HashMap<&str, isize > = HashMap::with_capacity(10);
640
+ /// let mut map: HashMap<&str, i32 > = HashMap::with_capacity(10);
641
641
/// ```
642
642
#[ inline]
643
643
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -724,7 +724,7 @@ impl<K, V, S> HashMap<K, V, S>
724
724
/// use std::collections::hash_map::RandomState;
725
725
///
726
726
/// let hasher = RandomState::new();
727
- /// let map: HashMap<isize, isize > = HashMap::with_hasher(hasher);
727
+ /// let map: HashMap<i32, i32 > = HashMap::with_hasher(hasher);
728
728
/// let hasher: &RandomState = map.hasher();
729
729
/// ```
730
730
#[ stable( feature = "hashmap_public_hasher" , since = "1.9.0" ) ]
@@ -741,7 +741,7 @@ impl<K, V, S> HashMap<K, V, S>
741
741
///
742
742
/// ```
743
743
/// use std::collections::HashMap;
744
- /// let map: HashMap<isize, isize > = HashMap::with_capacity(100);
744
+ /// let map: HashMap<i32, i32 > = HashMap::with_capacity(100);
745
745
/// assert!(map.capacity() >= 100);
746
746
/// ```
747
747
#[ inline]
@@ -770,7 +770,7 @@ impl<K, V, S> HashMap<K, V, S>
770
770
///
771
771
/// ```
772
772
/// use std::collections::HashMap;
773
- /// let mut map: HashMap<&str, isize > = HashMap::new();
773
+ /// let mut map: HashMap<&str, i32 > = HashMap::new();
774
774
/// map.reserve(10);
775
775
/// ```
776
776
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -849,7 +849,7 @@ impl<K, V, S> HashMap<K, V, S>
849
849
/// ```
850
850
/// use std::collections::HashMap;
851
851
///
852
- /// let mut map: HashMap<isize, isize > = HashMap::with_capacity(100);
852
+ /// let mut map: HashMap<i32, i32 > = HashMap::with_capacity(100);
853
853
/// map.insert(1, 2);
854
854
/// map.insert(3, 4);
855
855
/// assert!(map.capacity() >= 100);
@@ -1306,7 +1306,7 @@ impl<K, V, S> HashMap<K, V, S>
1306
1306
/// ```
1307
1307
/// use std::collections::HashMap;
1308
1308
///
1309
- /// let mut map: HashMap<isize, isize > = (0..8).map(|x|(x, x*10)).collect();
1309
+ /// let mut map: HashMap<i32, i32 > = (0..8).map(|x|(x, x*10)).collect();
1310
1310
/// map.retain(|&k, _| k % 2 == 0);
1311
1311
/// assert_eq!(map.len(), 4);
1312
1312
/// ```
@@ -1722,7 +1722,7 @@ impl<K, V, S> IntoIterator for HashMap<K, V, S>
1722
1722
/// map.insert("c", 3);
1723
1723
///
1724
1724
/// // Not possible with .iter()
1725
- /// let vec: Vec<(&str, isize )> = map.into_iter().collect();
1725
+ /// let vec: Vec<(&str, i32 )> = map.into_iter().collect();
1726
1726
/// ```
1727
1727
fn into_iter ( self ) -> IntoIter < K , V > {
1728
1728
IntoIter { inner : self . table . into_iter ( ) }
@@ -2786,34 +2786,34 @@ mod test_map {
2786
2786
assert_eq ! ( m2. len( ) , 2 ) ;
2787
2787
}
2788
2788
2789
- thread_local ! { static DROP_VECTOR : RefCell <Vec <isize >> = RefCell :: new( Vec :: new( ) ) }
2789
+ thread_local ! { static DROP_VECTOR : RefCell <Vec <i32 >> = RefCell :: new( Vec :: new( ) ) }
2790
2790
2791
2791
#[ derive( Hash , PartialEq , Eq ) ]
2792
- struct Dropable {
2792
+ struct Droppable {
2793
2793
k : usize ,
2794
2794
}
2795
2795
2796
- impl Dropable {
2797
- fn new ( k : usize ) -> Dropable {
2796
+ impl Droppable {
2797
+ fn new ( k : usize ) -> Droppable {
2798
2798
DROP_VECTOR . with ( |slot| {
2799
2799
slot. borrow_mut ( ) [ k] += 1 ;
2800
2800
} ) ;
2801
2801
2802
- Dropable { k : k }
2802
+ Droppable { k : k }
2803
2803
}
2804
2804
}
2805
2805
2806
- impl Drop for Dropable {
2806
+ impl Drop for Droppable {
2807
2807
fn drop ( & mut self ) {
2808
2808
DROP_VECTOR . with ( |slot| {
2809
2809
slot. borrow_mut ( ) [ self . k ] -= 1 ;
2810
2810
} ) ;
2811
2811
}
2812
2812
}
2813
2813
2814
- impl Clone for Dropable {
2815
- fn clone ( & self ) -> Dropable {
2816
- Dropable :: new ( self . k )
2814
+ impl Clone for Droppable {
2815
+ fn clone ( & self ) -> Droppable {
2816
+ Droppable :: new ( self . k )
2817
2817
}
2818
2818
}
2819
2819
@@ -2833,8 +2833,8 @@ mod test_map {
2833
2833
} ) ;
2834
2834
2835
2835
for i in 0 ..100 {
2836
- let d1 = Dropable :: new ( i) ;
2837
- let d2 = Dropable :: new ( i + 100 ) ;
2836
+ let d1 = Droppable :: new ( i) ;
2837
+ let d2 = Droppable :: new ( i + 100 ) ;
2838
2838
m. insert ( d1, d2) ;
2839
2839
}
2840
2840
@@ -2845,7 +2845,7 @@ mod test_map {
2845
2845
} ) ;
2846
2846
2847
2847
for i in 0 ..50 {
2848
- let k = Dropable :: new ( i) ;
2848
+ let k = Droppable :: new ( i) ;
2849
2849
let v = m. remove ( & k) ;
2850
2850
2851
2851
assert ! ( v. is_some( ) ) ;
@@ -2892,8 +2892,8 @@ mod test_map {
2892
2892
} ) ;
2893
2893
2894
2894
for i in 0 ..100 {
2895
- let d1 = Dropable :: new ( i) ;
2896
- let d2 = Dropable :: new ( i + 100 ) ;
2895
+ let d1 = Droppable :: new ( i) ;
2896
+ let d2 = Droppable :: new ( i + 100 ) ;
2897
2897
hm. insert ( d1, d2) ;
2898
2898
}
2899
2899
@@ -2943,13 +2943,13 @@ mod test_map {
2943
2943
2944
2944
#[ test]
2945
2945
fn test_empty_remove ( ) {
2946
- let mut m: HashMap < isize , bool > = HashMap :: new ( ) ;
2946
+ let mut m: HashMap < i32 , bool > = HashMap :: new ( ) ;
2947
2947
assert_eq ! ( m. remove( & 0 ) , None ) ;
2948
2948
}
2949
2949
2950
2950
#[ test]
2951
2951
fn test_empty_entry ( ) {
2952
- let mut m: HashMap < isize , bool > = HashMap :: new ( ) ;
2952
+ let mut m: HashMap < i32 , bool > = HashMap :: new ( ) ;
2953
2953
match m. entry ( 0 ) {
2954
2954
Occupied ( _) => panic ! ( ) ,
2955
2955
Vacant ( _) => { }
@@ -2960,7 +2960,7 @@ mod test_map {
2960
2960
2961
2961
#[ test]
2962
2962
fn test_empty_iter ( ) {
2963
- let mut m: HashMap < isize , bool > = HashMap :: new ( ) ;
2963
+ let mut m: HashMap < i32 , bool > = HashMap :: new ( ) ;
2964
2964
assert_eq ! ( m. drain( ) . next( ) , None ) ;
2965
2965
assert_eq ! ( m. keys( ) . next( ) , None ) ;
2966
2966
assert_eq ! ( m. values( ) . next( ) , None ) ;
@@ -3461,7 +3461,7 @@ mod test_map {
3461
3461
fn test_entry_take_doesnt_corrupt ( ) {
3462
3462
#![ allow( deprecated) ] //rand
3463
3463
// Test for #19292
3464
- fn check ( m : & HashMap < isize , ( ) > ) {
3464
+ fn check ( m : & HashMap < i32 , ( ) > ) {
3465
3465
for k in m. keys ( ) {
3466
3466
assert ! ( m. contains_key( k) ,
3467
3467
"{} is in keys() but not in the map?" , k) ;
@@ -3570,7 +3570,7 @@ mod test_map {
3570
3570
3571
3571
#[ test]
3572
3572
fn test_retain ( ) {
3573
- let mut map: HashMap < isize , isize > = ( 0 ..100 ) . map ( |x|( x, x* 10 ) ) . collect ( ) ;
3573
+ let mut map: HashMap < i32 , i32 > = ( 0 ..100 ) . map ( |x|( x, x* 10 ) ) . collect ( ) ;
3574
3574
3575
3575
map. retain ( |& k, _| k % 2 == 0 ) ;
3576
3576
assert_eq ! ( map. len( ) , 50 ) ;
0 commit comments