Formatting

This commit is contained in:
Robin Raymond 2022-06-19 09:22:32 +02:00
parent 7cefa8f995
commit 0b6e6e3d63
2 changed files with 5 additions and 2 deletions

View File

@ -511,7 +511,10 @@ impl<T> From<T> for RwLock<T> {
impl<'rwlock, T: ?Sized> RwLockReadGuard<'rwlock, T> { impl<'rwlock, T: ?Sized> RwLockReadGuard<'rwlock, T> {
unsafe fn new(lock: &'rwlock RwLock<T>) -> LockResult<RwLockReadGuard<'rwlock, T>> { unsafe fn new(lock: &'rwlock RwLock<T>) -> LockResult<RwLockReadGuard<'rwlock, T>> {
poison::map_result(lock.poison.borrow(), |()| RwLockReadGuard { inner_lock: &lock.inner, data: &*lock.data.get() }) poison::map_result(lock.poison.borrow(), |()| RwLockReadGuard {
inner_lock: &lock.inner,
data: &*lock.data.get()
})
} }
} }

View File

@ -1,6 +1,6 @@
use crate::sync::atomic::{AtomicUsize, Ordering}; use crate::sync::atomic::{AtomicUsize, Ordering};
use crate::sync::mpsc::channel; use crate::sync::mpsc::channel;
use crate::sync::{Arc, RwLock, TryLockError, RwLockReadGuard}; use crate::sync::{Arc, RwLock, RwLockReadGuard, TryLockError};
use crate::thread; use crate::thread;
use rand::{self, Rng}; use rand::{self, Rng};