diff --git a/src/lib.rs b/src/lib.rs index 347811c..e6c3e7e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -285,9 +285,8 @@ impl CpuPool { } async { - match opt { - Some(item) => self.state.queue.push(item).await, - None => {} + if let Some(item) = opt { + self.state.queue.push(item).await; } let current_threads = self diff --git a/src/notify.rs b/src/notify.rs index 8ce6b06..b5b25e3 100644 --- a/src/notify.rs +++ b/src/notify.rs @@ -158,7 +158,7 @@ impl Drop for Listener<'_> { let flags = self.woken.swap(RESOLVED, Ordering::AcqRel); if flags == RESOLVED { - return; + // do nothing } else if flags == NOTIFIED_ONE { let mut guard = self.state.lock().expect("not poisoned"); guard.notify_one();