Skip to content

Commit

Permalink
apply clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Mar 20, 2024
1 parent 8bed249 commit aab09ed
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/happy_eyeballs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ async fn open_tcp_socket(
}

// Start connecting. If an attempt succeeds, cancel all others attempts.
Ok(futures.race_ok().await?)
futures.race_ok().await
}
4 changes: 2 additions & 2 deletions src/concurrent_stream/for_each.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ where

async fn progress(self: Pin<&mut Self>) -> super::ConsumerState {
let mut this = self.project();
while let Some(_) = this.group.next().await {}
while (this.group.next().await).is_some() {}
ConsumerState::Empty
}

Expand All @@ -85,7 +85,7 @@ where
// 4. We will no longer receive any additional futures from the
// underlying stream; wait until all the futures in the group have
// resolved.
while let Some(_) = this.group.next().await {}
while (this.group.next().await).is_some() {}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/future/join/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ mod test {
use futures_lite::future::pending;

thread_local! {
static NOT_LEAKING: RefCell<bool> = RefCell::new(false);
static NOT_LEAKING: RefCell<bool> = const { RefCell::new(false) };
};

struct FlipFlagAtDrop;
Expand Down
2 changes: 1 addition & 1 deletion src/future/try_join/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ mod test {
use futures_lite::future::pending;

thread_local! {
static NOT_LEAKING: RefCell<bool> = RefCell::new(false);
static NOT_LEAKING: RefCell<bool> = const { RefCell::new(false) };
};

struct FlipFlagAtDrop;
Expand Down
6 changes: 3 additions & 3 deletions src/utils/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ pub struct PrivateMarker;
#[macro_export]
macro_rules! private_impl {
() => {
fn __futures_concurrency_private__(&self) -> crate::private::PrivateMarker {
crate::private::PrivateMarker
fn __futures_concurrency_private__(&self) -> $crate::private::PrivateMarker {
$crate::private::PrivateMarker
}
};
}
Expand All @@ -174,6 +174,6 @@ macro_rules! private_decl {
/// This trait is private; this method exists to make it
/// impossible to implement outside the crate.
#[doc(hidden)]
fn __futures_concurrency_private__(&self) -> crate::private::PrivateMarker;
fn __futures_concurrency_private__(&self) -> $crate::private::PrivateMarker;
};
}

0 comments on commit aab09ed

Please sign in to comment.