mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Use .take() rather than replace(..., None)
This commit is contained in:
parent
fc5ce97db4
commit
5f59a01c21
|
@ -11,7 +11,6 @@ impl<T> Singleton<T> {
|
||||||
Singleton { single: None }
|
Singleton { single: None }
|
||||||
}
|
}
|
||||||
pub fn take(&mut self) -> T {
|
pub fn take(&mut self) -> T {
|
||||||
let g = core::mem::replace(&mut self.single, None);
|
self.single.take().unwrap()
|
||||||
g.unwrap()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue