From 8311dac48428cb091a2dd4faee56e47898eb6a66 Mon Sep 17 00:00:00 2001 From: peamaeq Date: Wed, 4 May 2022 00:06:45 +0800 Subject: [PATCH] 0503 --- src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f05eee6..4133202 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -273,15 +273,13 @@ impl ConcreteBlock { impl ConcreteBlock where F: 'static { /// Copy self onto the heap as an `RcBlock`. pub fn copy(self) -> RcBlock { - unsafe { let mut block = self; - let copied = RcBlock::copy(&mut *block); + let copied = unsafe { RcBlock::copy(&mut *block) }; // At this point, our copy helper has been run so the block will // be moved to the heap and we can forget the original block // because the heap block will drop in our dispose helper. mem::forget(block); copied - } } }