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

Remove unnecessary brackets in chat example #2732

Merged
merged 1 commit into from
May 7, 2024
Merged

Conversation

srcres258
Copy link
Contributor

Motivation

Usage examples of the tokio::select macro mentioned in tokio's documentation indicate that brackets are redundant when writing the macro branches.

e.g. It's more preferred to write

    let next = tokio::select! {
        v = stream1.next() => v.unwrap(),
        v = stream2.next() => v.unwrap(),
    };

than

    let next = tokio::select! {
        v = (stream1.next()) => v.unwrap(),
        v = (stream2.next()) => v.unwrap(),
    };

Solution

Remove the unnecessary brackets in chat example code.

Copy link
Member

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Thanks!

@jplatte jplatte merged commit 8d0c5c0 into tokio-rs:main May 7, 2024
18 checks passed
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.

None yet

2 participants