-
Notifications
You must be signed in to change notification settings - Fork 636
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
Use AsyncFn family of traits (async closures) #2901
Comments
This looks interesting and I'd like to investigate it in futrues-rs. One prerequisite is bumping the MSRV and I wonder what our MSRV strategy is. That said, I'm trying to replace the dependency to This issue requires an MSRV >= 1.85 and I'm unsure when we can bump the MSRV to unblock the actual migration work. |
The next MSRV bump will probably be to 1.85 or 1.86 when Debian 13 is released. It will probably be 4 to 8 months later. However, you probably don't need to worry about that since the master branch is not scheduled for immediate release. Btw, this is actually already supported at least for some simple cases: use futures::stream::{self, StreamExt};
let stream = stream::iter(1..=3);
let stream = stream.then(async move |x| x + 3);
assert_eq!(vec![4, 5, 6], stream.collect::<Vec<_>>().await); However, doesn't seem to work if the closure bound is use futures::stream::{self, StreamExt};
let stream = stream::iter(1..=3);
// ok
let stream = stream.filter(|_x| async { true });
// error
let stream = stream.filter(async |_x| true);
rust-lang/rust#132706 says:
|
async closures have been stabilized in rust-lang/rust#132706 (Rust 1.85).
The text was updated successfully, but these errors were encountered: