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

clippy: Fixes blocks_in_conditions warning #2900

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

brooksprumo
Copy link

@brooksprumo brooksprumo commented Sep 11, 2024

Problem

Clippy throws this warning when I run locally:

warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
    --> cli/src/cluster_query.rs:1440:42
     |
1440 |       match ctrlc::try_set_handler(move || {
     |  __________________________________________^
1441 | |         let _ = signal_sender.send(());
1442 | |     }) {
     | |_____^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
     = note: `#[warn(clippy::blocks_in_conditions)]` on by default

Summary of Changes

Move the closure out of the scrutinee.

warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
    --> cli/src/cluster_query.rs:1440:42
     |
1440 |       match ctrlc::try_set_handler(move || {
     |  __________________________________________^
1441 | |         let _ = signal_sender.send(());
1442 | |     }) {
     | |_____^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
     = note: `#[warn(clippy::blocks_in_conditions)]` on by default
@brooksprumo brooksprumo self-assigned this Sep 11, 2024
@brooksprumo brooksprumo marked this pull request as ready for review September 11, 2024 16:43
@brooksprumo brooksprumo added the automerge automerge Merge this Pull Request automatically once CI passes label Sep 11, 2024
Copy link
Member

@yihau yihau left a comment

Choose a reason for hiding this comment

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

🪖

Copy link

mergify bot commented Sep 11, 2024

automerge label removed due to a CI failure

@mergify mergify bot removed the automerge automerge Merge this Pull Request automatically once CI passes label Sep 11, 2024
@brooksprumo brooksprumo merged commit 1184bc8 into anza-xyz:master Sep 11, 2024
42 checks passed
@brooksprumo brooksprumo deleted the clippy branch September 11, 2024 18:07
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