Skip to content

Commit 5d07751

Browse files
committed
Cargo fmt
1 parent d5b5a1a commit 5d07751

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

src/map.rs

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ pub(crate) fn make_hasher<K, Q, V, S>(hash_builder: &S) -> impl Fn(&(Q, V)) -> u
213213
where
214214
K: Borrow<Q>,
215215
Q: Hash,
216-
S: BuildHasher
216+
S: BuildHasher,
217217
{
218218
move |val| make_hash::<K, Q, S>(hash_builder, &val.0)
219219
}
@@ -242,10 +242,10 @@ where
242242

243243
#[cfg_attr(feature = "inline-more", inline)]
244244
pub(crate) fn make_hash<K, Q, S>(hash_builder: &S, val: &Q) -> u64
245-
where
246-
K: Borrow<Q>,
247-
Q: Hash + ?Sized,
248-
S: BuildHasher
245+
where
246+
K: Borrow<Q>,
247+
Q: Hash + ?Sized,
248+
S: BuildHasher,
249249
{
250250
#[cfg(feature = "ahash")]
251251
{
@@ -265,24 +265,24 @@ pub(crate) fn make_hash<K, Q, S>(hash_builder: &S, val: &Q) -> u64
265265

266266
#[cfg_attr(feature = "inline-more", inline)]
267267
pub(crate) fn make_insert_hash<K, S>(hash_builder: &S, val: &K) -> u64
268-
where
269-
K: Hash,
270-
S: BuildHasher
268+
where
269+
K: Hash,
270+
S: BuildHasher,
271271
{
272272
#[cfg(feature = "ahash")]
273-
{
274-
//This enables specialization to improve performance on primitive types
275-
use ahash::CallHasher;
276-
let state = hash_builder.build_hasher();
277-
K::get_hash(val, state)
278-
}
273+
{
274+
//This enables specialization to improve performance on primitive types
275+
use ahash::CallHasher;
276+
let state = hash_builder.build_hasher();
277+
K::get_hash(val, state)
278+
}
279279
#[cfg(not(feature = "ahash"))]
280-
{
281-
use core::hash::Hasher;
282-
let mut state = hash_builder.build_hasher();
283-
val.hash(&mut state);
284-
state.finish()
285-
}
280+
{
281+
use core::hash::Hasher;
282+
let mut state = hash_builder.build_hasher();
283+
val.hash(&mut state);
284+
state.finish()
285+
}
286286
}
287287

288288
#[cfg(feature = "ahash")]
@@ -860,7 +860,8 @@ where
860860
/// ```
861861
#[cfg_attr(feature = "inline-more", inline)]
862862
pub fn shrink_to_fit(&mut self) {
863-
self.table.shrink_to(0, make_hasher::<K, _, V, S>(&self.hash_builder));
863+
self.table
864+
.shrink_to(0, make_hasher::<K, _, V, S>(&self.hash_builder));
864865
}
865866

866867
/// Shrinks the capacity of the map with a lower limit. It will drop
@@ -1269,7 +1270,6 @@ impl<K, V, S, A: AllocRef + Clone> HashMap<K, V, S, A> {
12691270
pub fn raw_entry(&self) -> RawEntryBuilder<'_, K, V, S, A> {
12701271
RawEntryBuilder { map: self }
12711272
}
1272-
12731273
}
12741274

12751275
impl<K, V, S, A> PartialEq for HashMap<K, V, S, A>
@@ -2098,9 +2098,11 @@ impl<'a, K, V, S, A: AllocRef + Clone> RawVacantEntryMut<'a, K, V, S, A> {
20982098
K: Hash,
20992099
S: BuildHasher,
21002100
{
2101-
let &mut (ref mut k, ref mut v) =
2102-
self.table
2103-
.insert_entry(hash, (key, value), make_hasher::<K, _, V, S>(self.hash_builder));
2101+
let &mut (ref mut k, ref mut v) = self.table.insert_entry(
2102+
hash,
2103+
(key, value),
2104+
make_hasher::<K, _, V, S>(self.hash_builder),
2105+
);
21042106
(k, v)
21052107
}
21062108

@@ -2129,9 +2131,11 @@ impl<'a, K, V, S, A: AllocRef + Clone> RawVacantEntryMut<'a, K, V, S, A> {
21292131
S: BuildHasher,
21302132
{
21312133
let hash = make_insert_hash::<K, S>(self.hash_builder, &key);
2132-
let elem = self
2133-
.table
2134-
.insert(hash, (key, value), make_hasher::<K, _, V, S>(self.hash_builder));
2134+
let elem = self.table.insert(
2135+
hash,
2136+
(key, value),
2137+
make_hasher::<K, _, V, S>(self.hash_builder),
2138+
);
21352139
RawOccupiedEntryMut {
21362140
elem,
21372141
table: self.table,

0 commit comments

Comments
 (0)