@@ -606,7 +606,7 @@ where
606
606
}
607
607
608
608
/// Tries to reserve capacity for at least `additional` more elements to be inserted
609
- /// in the given `HashMap<K,V>`. The collection may reserve more space to avoid
609
+ /// in the given `HashMap<K, V>`. The collection may reserve more space to avoid
610
610
/// frequent reallocations.
611
611
///
612
612
/// # Errors
@@ -619,6 +619,7 @@ where
619
619
/// ```
620
620
/// #![feature(try_reserve)]
621
621
/// use std::collections::HashMap;
622
+ ///
622
623
/// let mut map: HashMap<&str, isize> = HashMap::new();
623
624
/// map.try_reserve(10).expect("why is the test harness OOMing on 10 bytes?");
624
625
/// ```
@@ -898,14 +899,14 @@ where
898
899
899
900
/// Retains only the elements specified by the predicate.
900
901
///
901
- /// In other words, remove all pairs `(k, v)` such that `f(&k,&mut v)` returns `false`.
902
+ /// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`.
902
903
///
903
904
/// # Examples
904
905
///
905
906
/// ```
906
907
/// use std::collections::HashMap;
907
908
///
908
- /// let mut map: HashMap<i32, i32> = (0..8).map(|x|(x, x*10)).collect();
909
+ /// let mut map: HashMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();
909
910
/// map.retain(|&k, _| k % 2 == 0);
910
911
/// assert_eq!(map.len(), 4);
911
912
/// ```
0 commit comments