Rollup merge of #117940 - zhiqiangxu:remove_redundant_drop, r=thomcc

chore: remove unnecessary drop

 No need to manually drop since it's implicit.
This commit is contained in:
Matthias Krüger 2023-11-24 08:23:52 +01:00 committed by GitHub
commit f38de06ce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

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.