Skip to content

Commit aab09ed

Browse files
committed
apply clippy fixes
1 parent 8bed249 commit aab09ed

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

examples/happy_eyeballs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ async fn open_tcp_socket(
4444
}
4545

4646
// Start connecting. If an attempt succeeds, cancel all others attempts.
47-
Ok(futures.race_ok().await?)
47+
futures.race_ok().await
4848
}

src/concurrent_stream/for_each.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ where
7676

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

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

src/future/join/tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ mod test {
338338
use futures_lite::future::pending;
339339

340340
thread_local! {
341-
static NOT_LEAKING: RefCell<bool> = RefCell::new(false);
341+
static NOT_LEAKING: RefCell<bool> = const { RefCell::new(false) };
342342
};
343343

344344
struct FlipFlagAtDrop;

src/future/try_join/tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ mod test {
382382
use futures_lite::future::pending;
383383

384384
thread_local! {
385-
static NOT_LEAKING: RefCell<bool> = RefCell::new(false);
385+
static NOT_LEAKING: RefCell<bool> = const { RefCell::new(false) };
386386
};
387387

388388
struct FlipFlagAtDrop;

src/utils/private.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ pub struct PrivateMarker;
161161
#[macro_export]
162162
macro_rules! private_impl {
163163
() => {
164-
fn __futures_concurrency_private__(&self) -> crate::private::PrivateMarker {
165-
crate::private::PrivateMarker
164+
fn __futures_concurrency_private__(&self) -> $crate::private::PrivateMarker {
165+
$crate::private::PrivateMarker
166166
}
167167
};
168168
}
@@ -174,6 +174,6 @@ macro_rules! private_decl {
174174
/// This trait is private; this method exists to make it
175175
/// impossible to implement outside the crate.
176176
#[doc(hidden)]
177-
fn __futures_concurrency_private__(&self) -> crate::private::PrivateMarker;
177+
fn __futures_concurrency_private__(&self) -> $crate::private::PrivateMarker;
178178
};
179179
}

0 commit comments

Comments
 (0)