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