Skip to content

Commit e8ca391

Browse files
authored
Rollup merge of rust-lang#117940 - zhiqiangxu:remove_redundant_drop, r=thomcc
chore: remove unnecessary drop No need to manually drop since it's implicit.
2 parents 5cb0d5a + 2c360bd commit e8ca391

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/cell.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,7 @@ impl<T> Cell<T> {
409409
#[inline]
410410
#[stable(feature = "rust1", since = "1.0.0")]
411411
pub fn set(&self, val: T) {
412-
let old = self.replace(val);
413-
drop(old);
412+
self.replace(val);
414413
}
415414

416415
/// Swaps the values of two `Cell`s.

0 commit comments

Comments
 (0)