Skip to content
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

Add TryFutureExt::map_ok_or_else method #2058

Merged
merged 3 commits into from
Feb 3, 2020

Conversation

Xaeroxe
Copy link
Contributor

@Xaeroxe Xaeroxe commented Jan 31, 2020

Similar to the recently stabilized Result::map_or_else method, this adds a method to the TryFutureExt trait that fulfills a similar purpose.

E: FnOnce(Fut::Error) -> T,
{
fn is_terminated(&self) -> bool {
self.f.is_none()
Copy link
Member

Choose a reason for hiding this comment

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

This should be self.f.is_none() || self.e.is_none()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed!

@cramertj
Copy link
Member

cramertj commented Feb 3, 2020

Thanks!

@cramertj cramertj merged commit 1329276 into rust-lang:master Feb 3, 2020
@Xaeroxe Xaeroxe deleted the map_ok_or_else branch February 4, 2020 01:57
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