remove unnecessary drop

This commit is contained in:
zhiqiangxu 2023-11-16 00:01:57 +08:00 committed by GitHub
parent 1500db7314
commit a355df4432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -409,8 +409,7 @@ impl<T> Cell<T> {
#[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.