mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
Formatting
This commit is contained in:
parent
7cefa8f995
commit
0b6e6e3d63
@ -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()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user