Skip to content

Commit f38de06

Browse files
authored
Rollup merge of #117940 - zhiqiangxu:remove_redundant_drop, r=thomcc
chore: remove unnecessary drop No need to manually drop since it's implicit.
2 parents 7e3ec1b + a355df4 commit f38de06

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/core/src/cell.rs

+1-2
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)