diff --git a/src/helpers/filter_nulls_and_unwrap.rs b/src/helpers/filter_nulls_and_unwrap.rs index 440a7a78..5435d8d2 100644 --- a/src/helpers/filter_nulls_and_unwrap.rs +++ b/src/helpers/filter_nulls_and_unwrap.rs @@ -1,3 +1,5 @@ +#![allow(clippy::type_complexity, clippy::option_option)] + use crate::par_stream::{Filter, Map}; use amadeus_core::par_stream::ParallelStream; @@ -17,8 +19,7 @@ where fn filter_nulls_and_unwrap( self, ) -> Map, fn(Option) -> O> { - self.filter(OptionFilterNullHandler {}) - .map(|unwrapped_value: Option| unwrapped_value.unwrap()) + self.filter(OptionFilterNullHandler {}).map(Option::unwrap) } } diff --git a/src/pool/util.rs b/src/pool/util.rs index af61c67d..7db0e9c0 100644 --- a/src/pool/util.rs +++ b/src/pool/util.rs @@ -89,7 +89,11 @@ impl Synchronize { F: Future, { let nonce = self.nonce.load(Ordering::SeqCst); - if !self.running.compare_and_swap(false, true, Ordering::SeqCst) { + if self + .running + .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) + .is_ok() + { let on_drop = OnDrop::new(|| self.running.store(false, Ordering::SeqCst)); f.await; on_drop.cancel();