]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/crashes/if_same_then_else.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / tools / clippy / 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 }