]> git.nega.tv - josh/narcissus/commitdiff
narcissus-core: Fix clippy lints
authorJoshua Simmons <josh@nega.tv>
Sun, 4 Jun 2023 09:06:47 +0000 (11:06 +0200)
committerJoshua Simmons <josh@nega.tv>
Sun, 4 Jun 2023 09:06:47 +0000 (11:06 +0200)
libs/narcissus-core/src/manual_arc.rs

index 7e4a007cd69f119687d908cac1e0bbecb01086ab..f83e86aa4be1dc9d20dde19ff4ad0ca8836cf3dc 100644 (file)
@@ -101,7 +101,7 @@ impl<T> ManualArc<T> {
         // always valid here.
         unsafe {
             // Replace ptr with None so that the drop function doesn't panic
-            let ptr = std::mem::replace(&mut self.ptr, None);
+            let ptr = self.ptr.take();
             let ptr = ptr.unwrap_unchecked();
             let inner = ptr.as_ref();
             if inner.decr_strong() {