Rust

Rust

Made by DeepSource

Matching over boolean RS-C1011

Anti-pattern
Minor
Autofix

Matching over a boolean expression is less readable than using an if-else block.

Replace the match block with an if-else block.

Bad practice

match condition {
    true => foo(),
    false => bar(),
}

Recommended

if condition {
    foo()
} else {
    bar()
}