14 lines
340 B
Rust
14 lines
340 B
Rust
#![warn(clippy::obfuscated_if_else)]
|
|
#![allow(clippy::unnecessary_lazy_evaluations)]
|
|
|
|
fn main() {
|
|
if true { "a" } else { "b" };
|
|
if true { "a" } else { "b" };
|
|
|
|
let a = 1;
|
|
if a == 1 { "a" } else { "b" };
|
|
if a == 1 { "a" } else { "b" };
|
|
|
|
let partial = (a == 1).then_some("a");
|
|
partial.unwrap_or("b"); // not lint
|
|
}
|