From a355df44320f516547cd1e715ff9ea694256c978 Mon Sep 17 00:00:00 2001 From: zhiqiangxu <652732310@qq.com> Date: Thu, 16 Nov 2023 00:01:57 +0800 Subject: [PATCH] remove unnecessary drop --- library/core/src/cell.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 0978b3c92805e..f10a82c569496 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -409,8 +409,7 @@ impl Cell { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn set(&self, val: T) { - let old = self.replace(val); - drop(old); + self.replace(val); } /// Swaps the values of two `Cell`s.