cargo clippy & fmt

This commit is contained in:
Yifan Wu 2022-01-21 14:56:19 -08:00
parent 8917eb7acc
commit b96db03e48
62 changed files with 887 additions and 938 deletions

View file

@ -18,10 +18,12 @@ impl<T> UPSafeCell<T> {
/// User is responsible to guarantee that inner struct is only used in
/// uniprocessor.
pub unsafe fn new(value: T) -> Self {
Self { inner: RefCell::new(value) }
Self {
inner: RefCell::new(value),
}
}
/// Panic if the data has been borrowed.
pub fn exclusive_access(&self) -> RefMut<'_, T> {
self.inner.borrow_mut()
}
}
}