diff --git a/examples/happy_eyeballs.rs b/examples/happy_eyeballs.rs index ed591cd..63da6ce 100644 --- a/examples/happy_eyeballs.rs +++ b/examples/happy_eyeballs.rs @@ -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 } diff --git a/src/concurrent_stream/for_each.rs b/src/concurrent_stream/for_each.rs index 89d1ea6..a9b6dc7 100644 --- a/src/concurrent_stream/for_each.rs +++ b/src/concurrent_stream/for_each.rs @@ -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 } @@ -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() {} } } diff --git a/src/future/join/tuple.rs b/src/future/join/tuple.rs index b797494..0d01995 100644 --- a/src/future/join/tuple.rs +++ b/src/future/join/tuple.rs @@ -338,7 +338,7 @@ mod test { use futures_lite::future::pending; thread_local! { - static NOT_LEAKING: RefCell = RefCell::new(false); + static NOT_LEAKING: RefCell = const { RefCell::new(false) }; }; struct FlipFlagAtDrop; diff --git a/src/future/try_join/tuple.rs b/src/future/try_join/tuple.rs index 8094b48..8cf1152 100644 --- a/src/future/try_join/tuple.rs +++ b/src/future/try_join/tuple.rs @@ -382,7 +382,7 @@ mod test { use futures_lite::future::pending; thread_local! { - static NOT_LEAKING: RefCell = RefCell::new(false); + static NOT_LEAKING: RefCell = const { RefCell::new(false) }; }; struct FlipFlagAtDrop; diff --git a/src/utils/private.rs b/src/utils/private.rs index 3dbb42e..b0fb1e6 100644 --- a/src/utils/private.rs +++ b/src/utils/private.rs @@ -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 } }; } @@ -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; }; }