Skip to content

Commit 2c25e93

Browse files
committed
clippy fixes
1 parent b5a3ab0 commit 2c25e93

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/helpers/filter_nulls_and_unwrap.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::type_complexity, clippy::option_option)]
2+
13
use crate::par_stream::{Filter, Map};
24
use amadeus_core::par_stream::ParallelStream;
35

@@ -17,8 +19,7 @@ where
1719
fn filter_nulls_and_unwrap(
1820
self,
1921
) -> Map<Filter<T, OptionFilterNullHandler>, fn(Option<O>) -> O> {
20-
self.filter(OptionFilterNullHandler {})
21-
.map(|unwrapped_value: Option<O>| unwrapped_value.unwrap())
22+
self.filter(OptionFilterNullHandler {}).map(Option::unwrap)
2223
}
2324
}
2425

src/pool/util.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ impl Synchronize {
8989
F: Future<Output = ()>,
9090
{
9191
let nonce = self.nonce.load(Ordering::SeqCst);
92-
if !self.running.compare_and_swap(false, true, Ordering::SeqCst) {
92+
if self
93+
.running
94+
.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
95+
.is_ok()
96+
{
9397
let on_drop = OnDrop::new(|| self.running.store(false, Ordering::SeqCst));
9498
f.await;
9599
on_drop.cancel();

0 commit comments

Comments
 (0)