From 5f59a01c21f7e55999e6b43fed8f391c536a8e23 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Wed, 12 Apr 2023 13:49:22 +0100 Subject: [PATCH] Use .take() rather than replace(..., None) --- agb/src/single.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agb/src/single.rs b/agb/src/single.rs index 2d6e11d4..0215ab63 100644 --- a/agb/src/single.rs +++ b/agb/src/single.rs @@ -11,7 +11,6 @@ impl Singleton { Singleton { single: None } } pub fn take(&mut self) -> T { - let g = core::mem::replace(&mut self.single, None); - g.unwrap() + self.single.take().unwrap() } }