Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmocatta committed Apr 5, 2021
1 parent b5a3ab0 commit 2c25e93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/helpers/filter_nulls_and_unwrap.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::type_complexity, clippy::option_option)]

use crate::par_stream::{Filter, Map};
use amadeus_core::par_stream::ParallelStream;

Expand All @@ -17,8 +19,7 @@ where
fn filter_nulls_and_unwrap(
self,
) -> Map<Filter<T, OptionFilterNullHandler>, fn(Option<O>) -> O> {
self.filter(OptionFilterNullHandler {})
.map(|unwrapped_value: Option<O>| unwrapped_value.unwrap())
self.filter(OptionFilterNullHandler {}).map(Option::unwrap)
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/pool/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ impl Synchronize {
F: Future<Output = ()>,
{
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();
Expand Down

0 comments on commit 2c25e93

Please sign in to comment.