feat: relax FutureExt trait bound to extend IntoFuture impls instead#31
Merged
Merged
Conversation
Also add the MSRV to Cargo.toml
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Howdy!
This is a bit of an extension of #26, but more general.
Currently
FutureExtonly extends types that implFuture, allowing you to call.block_on()instead of.awaiton those types.However this does not work for types that happen to impl
IntoFutureinstead, despite them also being capable of being.await-ed typically... Additionally, in the documentation forIntoFuture, it describes how calling.awaitdesugars into aIntoFuture::into_futureinvocation followed by the usualpoll()-ing to completion.As such, all
impl Futuretypes also implIntoFutureby the nature of the blanket impl withinstd/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 agitdependency.Lemme know if you have any questions!