Skip to content

fix: prepare for edition 2024 #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ slab = { version = "0.4.9", optional = true }
smallvec = { version = "1.13", optional = true }
futures-buffered = "0.2.9"

[patch.crates-io]
half = { version = "2.4.1", git = "https://github.com/VoidStarKat/half-rs.git", tag = "v2.4.1" }

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this?

Copy link
Author

@reneleonhardt reneleonhardt Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrade indirect dependency half to 2.4.1 (2.5.0 requires MSRV 1.81.0)

Half upgraded to MSRV 1.81.0, that's why I had to downgrade it.
Would you like me to upgrade here too from 1.75.0?
Then I could remove this patch.
https://crates.io/crates/half/versions

Edition 2024 would require 1.85.0.

Screenshot 2025-06-30 at 10 52 03

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping to MRSV 1.81.0 allowed me to upgrade the last two outdated dependencies, is that ok?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you for clarifying. I have no objections to bumping the MSRV, but want to check with @matheus-consoli who introduced the MSRV checks before approving this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative were to move benches into a separate create.
There you could manage the MSRV separately from release dependencies (half is an indirect dependency of criterion).

[dev-dependencies]
async-io = "2.4"
async-std = { version = "1.13.0", features = ["attributes"] }
Expand All @@ -50,7 +53,7 @@ criterion = { version = "0.5", features = [
] }
futures = "0.3"
futures-time = "3.0.0"
itertools = "0.13"
itertools = "0.14"
lending-stream = "1.0.1"
rand = "0.8.5"
rand = "0.9.1"
tokio = { version = "1.41", features = ["macros", "time", "rt-multi-thread"] }
2 changes: 1 addition & 1 deletion src/concurrent_stream/from_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ where
type Item = S::Item;
type Future = Ready<Self::Item>;

async fn drive<C>(self, mut consumer: C) -> C::Output
async fn drive<C>(self, consumer: C) -> C::Output
where
C: Consumer<Self::Item, Self::Future>,
{
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 @@ -246,7 +246,7 @@ macro_rules! impl_join_tuple {
fn drop(self: Pin<&mut Self>) {
let this = self.project();

let ($(ref mut $F,)+) = this.outputs;
let &mut ($(ref mut $F,)+) = this.outputs;

let states = this.state;
let mut futures = this.futures;
Expand Down
4 changes: 2 additions & 2 deletions src/future/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! let b = future::ready(2);
//! let c = future::ready(3);
//! assert_eq!([a, b, c].join().await, [1, 2, 3]);
//!
//!
//! // Await multiple differently-typed futures.
//! let a = future::ready(1u8);
//! let b = future::ready("hello");
Expand Down Expand Up @@ -66,7 +66,7 @@
//!
//! - `future::TryMerge`: wait for all futures in the set to complete _successfully_, or return on the first error.
//! - `future::RaceOk`: wait for the first _successful_ future in the set to
//! complete, or return an `Err` if *no* futures complete successfully.
//! complete, or return an `Err` if *no* futures complete successfully.
//!
#[doc(inline)]
#[cfg(feature = "alloc")]
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 @@ -280,7 +280,7 @@ macro_rules! impl_try_join_tuple {
fn drop(self: Pin<&mut Self>) {
let this = self.project();

let ($(ref mut $F,)+) = this.outputs;
let &mut ($(ref mut $F,)+) = this.outputs;

let states = this.state;
let mut futures = this.futures;
Expand Down
14 changes: 6 additions & 8 deletions src/utils/poll_state/maybe_done.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ where
MaybeDone::Done(Ok(_)) => {}
MaybeDone::Done(Err(_)) | MaybeDone::Future(_) | MaybeDone::Gone => return None,
}
if let MaybeDone::Done(Ok(output)) = mem::replace(this, MaybeDone::Gone) {
Some(output)
} else {
unreachable!()
match mem::replace(this, MaybeDone::Gone) {
MaybeDone::Done(Ok(output)) => Some(output),
_ => unreachable!(),
}
}

Expand All @@ -53,10 +52,9 @@ where
MaybeDone::Done(Err(_)) => {}
MaybeDone::Done(Ok(_)) | MaybeDone::Future(_) | MaybeDone::Gone => return None,
}
if let MaybeDone::Done(Err(output)) = mem::replace(this, MaybeDone::Gone) {
Some(output)
} else {
unreachable!()
match mem::replace(this, MaybeDone::Gone) {
MaybeDone::Done(Err(output)) => Some(output),
_ => unreachable!(),
}
}
}
Expand Down
Loading