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 - } } }