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

macro select no branch else only #6339

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

GilShoshan94
Copy link
Contributor

@GilShoshan94 GilShoshan94 commented Feb 12, 2024

Motivation

Closes #6338

Solution

It's the propesed "Alternative 3" "Alternative 5" described in here.
It simply adds a special case for when the select! has no branches except for the else fallback branch (for the case with and without biased mode). It will simply expand to the code in $else.

I added 2 tests case too to cover it.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-macros Module: macros in the main Tokio crate labels Feb 12, 2024
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thank you.

@Darksonn Darksonn merged commit 2ce1cee into tokio-rs:master Feb 13, 2024
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-macros Module: macros in the main Tokio crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tokio::select! with only an "else branch"
2 participants