cargo fmt (#23)

This commit was merged in pull request #23.
This commit is contained in:
6543
2024-08-22 03:24:12 +02:00
committed by GitHub
parent f58c748f80
commit c9fe1be10b
3 changed files with 80 additions and 61 deletions

View File

@@ -13,9 +13,7 @@ impl<T: Send + Sync + ?Sized> Registry<T> {
Registry(const_mutex(None))
}
fn lock(&self) -> MappedMutexGuard<FxHashMap<usize, Weak<T>>> {
MutexGuard::map(self.0.lock(), |r| {
r.get_or_insert_with(FxHashMap::default)
})
MutexGuard::map(self.0.lock(), |r| r.get_or_insert_with(FxHashMap::default))
}
pub fn add(&self, t: T) -> Arc<T>
where
@@ -118,9 +116,7 @@ impl<T: Send + Sync + ?Sized> OwnedRegistry<T> {
OwnedRegistry(const_mutex(None))
}
fn lock(&self) -> MappedMutexGuard<FxHashMap<usize, Arc<T>>> {
MutexGuard::map(self.0.lock(), |r| {
r.get_or_insert_with(FxHashMap::default)
})
MutexGuard::map(self.0.lock(), |r| r.get_or_insert_with(FxHashMap::default))
}
pub fn add(&self, t: T) -> Arc<T>
where