Skip to content

feat: relax FutureExt trait bound to extend IntoFuture impls instead#31

Merged
zesterer merged 1 commit into
zesterer:masterfrom
nullstalgia:feat/intofuture-ext
Jul 9, 2026
Merged

feat: relax FutureExt trait bound to extend IntoFuture impls instead#31
zesterer merged 1 commit into
zesterer:masterfrom
nullstalgia:feat/intofuture-ext

Conversation

@nullstalgia

@nullstalgia nullstalgia commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Howdy!

This is a bit of an extension of #26, but more general.

Currently FutureExt only extends types that impl Future, allowing you to call .block_on() instead of .await on those types.

However this does not work for types that happen to impl IntoFuture instead, despite them also being capable of being .await-ed typically... Additionally, in the documentation for IntoFuture, it describes how calling .await desugars into a IntoFuture::into_future invocation followed by the usual poll()-ing to completion.

As such, all impl Future types also impl IntoFuture by the nature of the blanket impl within std/core, impl<F: Future> IntoFuture for F.

As far as I can tell, this change shouldn't break anything due to the above, including the MSRV (and as an aside, this also adds the MSRV to Cargo.toml).

--

My other intention with this PR is to potentially trigger a new release to crates.io, since the current unsafe-less version is quite nice, but is not currently available for mass consumption without adding a git dependency.

Lemme know if you have any questions!

@zesterer

zesterer commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Thanks! I had thought this crate was feature-complete, but this is certainly a great addition.

I think I'm going to use this as a point to draw an arbitrary line in the sand and release this as 1.0.

@zesterer
zesterer merged commit 268ecdb into zesterer:master Jul 9, 2026
2 of 3 checks passed
@nullstalgia
nullstalgia deleted the feat/intofuture-ext branch July 10, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants