mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 02:09:26 +02:00
rustfmt: core
This commit is contained in:
parent
0d92ac74d1
commit
c9ba73c9ef
21 changed files with 290 additions and 249 deletions
|
@ -36,15 +36,15 @@ macro_rules! component {
|
|||
}
|
||||
}
|
||||
|
||||
use std::sync::Mutex;
|
||||
use std::cell::UnsafeCell;
|
||||
use std::sync::Mutex;
|
||||
|
||||
pub struct Lazy<T>(Mutex<bool>, UnsafeCell<Option<T>>);
|
||||
unsafe impl <T: Sync> Sync for Lazy<T> {}
|
||||
unsafe impl <T: Send> Send for Lazy<T> {}
|
||||
unsafe impl<T: Sync> Sync for Lazy<T> {}
|
||||
unsafe impl<T: Send> Send for Lazy<T> {}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]
|
||||
impl <T> Lazy<T> {
|
||||
impl<T> Lazy<T> {
|
||||
pub fn new() -> Lazy<T> {
|
||||
Lazy(Mutex::new(false), UnsafeCell::new(None))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue