Skip to content

Commit

Permalink
remove unnecessary drop
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu committed Nov 15, 2023
1 parent 1500db7 commit a355df4
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 a355df4

Please sign in to comment.