]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/if_same_then_else.rs
Auto merge of #4593 - james9909:fix-multiple-inherent-impls, r=llogiq
[rust.git] / tests / ui / crashes / if_same_then_else.rs
1 // run-pass
2
3 #![allow(clippy::comparison_chain)]
4 #![deny(clippy::if_same_then_else)]
5
6 /// Test for https://github.com/rust-lang/rust-clippy/issues/2426
7
8 fn main() {}
9
10 pub fn foo(a: i32, b: i32) -> Option<&'static str> {
11     if a == b {
12         None
13     } else if a > b {
14         Some("a pfeil b")
15     } else {
16         None
17     }
18 }