@@ -849,6 +849,7 @@ impl<K, V, S> HashMap<K, V, S>
849
849
/// let mut map: HashMap<&str, i32> = HashMap::new();
850
850
/// map.reserve(10);
851
851
/// ```
852
+ #[ inline]
852
853
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
853
854
pub fn reserve ( & mut self , additional : usize ) {
854
855
match self . reserve_internal ( additional, Infallible ) {
@@ -880,6 +881,7 @@ impl<K, V, S> HashMap<K, V, S>
880
881
self . reserve_internal ( additional, Fallible )
881
882
}
882
883
884
+ #[ inline]
883
885
fn reserve_internal ( & mut self , additional : usize , fallibility : Fallibility )
884
886
-> Result < ( ) , CollectionAllocErr > {
885
887
@@ -1571,6 +1573,7 @@ impl<K, V, S> HashMap<K, V, S>
1571
1573
/// so that the map now contains keys which compare equal, search may start
1572
1574
/// acting erratically, with two keys randomly masking each other. Implementations
1573
1575
/// are free to assume this doesn't happen (within the limits of memory-safety).
1576
+ #[ inline( always) ]
1574
1577
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1575
1578
pub fn raw_entry_mut ( & mut self ) -> RawEntryBuilderMut < K , V , S > {
1576
1579
self . reserve ( 1 ) ;
@@ -1911,6 +1914,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
1911
1914
}
1912
1915
1913
1916
/// Create a `RawEntryMut` from the given key and its hash.
1917
+ #[ inline]
1914
1918
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1915
1919
pub fn from_key_hashed_nocheck < Q : ?Sized > ( self , hash : u64 , k : & Q ) -> RawEntryMut < ' a , K , V , S >
1916
1920
where K : Borrow < Q > ,
@@ -1919,6 +1923,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
1919
1923
self . from_hash ( hash, |q| q. borrow ( ) . eq ( k) )
1920
1924
}
1921
1925
1926
+ #[ inline]
1922
1927
fn search < F > ( self , hash : u64 , is_match : F , compare_hashes : bool ) -> RawEntryMut < ' a , K , V , S >
1923
1928
where for < ' b > F : FnMut ( & ' b K ) -> bool ,
1924
1929
{
@@ -1941,6 +1946,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
1941
1946
}
1942
1947
}
1943
1948
/// Create a `RawEntryMut` from the given hash.
1949
+ #[ inline]
1944
1950
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1945
1951
pub fn from_hash < F > ( self , hash : u64 , is_match : F ) -> RawEntryMut < ' a , K , V , S >
1946
1952
where for < ' b > F : FnMut ( & ' b K ) -> bool ,
@@ -2215,6 +2221,7 @@ impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> {
2215
2221
2216
2222
/// Sets the value of the entry with the VacantEntry's key,
2217
2223
/// and returns a mutable reference to it.
2224
+ #[ inline]
2218
2225
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
2219
2226
pub fn insert_hashed_nocheck ( self , hash : u64 , key : K , value : V ) -> ( & ' a mut K , & ' a mut V ) {
2220
2227
let hash = SafeHash :: new ( hash) ;
0 commit comments