then_some(..).unwrap_or(..)
RS-C1015Using then_some(..).unwrap_or(..)
obfuscates the comparison itself
and reduces code readability. It can be better written as an if-else
block.
fn foo() -> usize {
(0 == 1).then_some(1).unwrap_or(0)
}
fn foo() -> usize {
if 0 == 1 { 1 } else { 0 }
}