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 is_x() methods for all EitherN enum variants #3650

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

avsaase
Copy link
Contributor

@avsaase avsaase commented Dec 14, 2024

This add is_x() methods on all EitherN enums to more concisely check which future from a SelectN completed first, without accessing the value.

I often use signals for canceling futures "from within" and it's not always needed to access the value of the future, only to know if the signal wait future completed first. This can of course also be achieved using matches!, if-let or let-else, but the methods added in this PR make this a bit more concise.

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.

1 participant