Clippy: 1.86: Handle style lint for Option.replace

https://rust-lang.github.io/rust-clippy/stable/index.html#mem_replace_option_with_some
This commit is contained in:
Henrik Tjäder 2025-05-28 20:45:36 +02:00 committed by Emil Fresk
parent af871941d3
commit 8c9770db0c

View file

@ -35,8 +35,7 @@ impl CriticalSectionWakerRegistration {
Some(ref w2) if (w2.will_wake(new_waker)) => {}
_ => {
// clone the new waker and store it
if let Some(old_waker) = core::mem::replace(self_waker, Some(new_waker.clone()))
{
if let Some(old_waker) = self_waker.replace(new_waker.clone()) {
// We had a waker registered for another task. Wake it, so the other task can
// reregister itself if it's still interested.
//