mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +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 }
|
||||
}
|
||||
pub fn take(&mut self) -> T {
|
||||
let g = core::mem::replace(&mut self.single, None);
|
||||
g.unwrap()
|
||||
self.single.take().unwrap()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue