about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/crashes/if_same_then_else.rs
blob: 8a27b3c6d47db351043c05a4df0310b07a07cb1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ check-pass

#![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
    }
}