summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/if_same_then_else.rs
blob: 2f913292995eae24e5fe19af0f13aae65a5afb9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![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
    }
}