Files
rust/tests/ui/crashes/if_same_then_else.rs
Guillaume Gomez f666fd6417 Update UI tests
2025-02-15 13:38:16 +01:00

19 lines
333 B
Rust

//@ check-pass
#![allow(clippy::comparison_chain)]
#![deny(clippy::if_same_then_else)]
// Test for https://github.com/rust-lang/rust-clippy/issues/2426
fn main() {}
pub fn foo(a: i32, b: i32) -> Option<&'static str> {
if a == b {
None
} else if a > b {
Some("a pfeil b")
} else {
None
}
}