Skip to content

Commit

Permalink
Rollup merge of rust-lang#117940 - zhiqiangxu:remove_redundant_drop, …
Browse files Browse the repository at this point in the history
…r=thomcc

chore: remove unnecessary drop

 No need to manually drop since it's implicit.
  • Loading branch information
matthiaskrgr committed Nov 24, 2023
2 parents 7e3ec1b + a355df4 commit f38de06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f38de06

Please sign in to comment.