]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/crashes/if_same_then_else.rs
Rollup merge of #71806 - lcnr:patch-3, r=jonas-schievink
[rust.git] / src / tools / clippy / 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 }