Rust logoRust/
RS-C1011

Matching over booleanRS-C1011

Minor severityMinor
Anti-pattern categoryAnti-pattern

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(),
}
if condition {
    foo()
} else {
    bar()
}