]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/crashes/if_same_then_else.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / crashes / if_same_then_else.rs
CommitLineData
f20569fa
XL
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
6fn main() {}
7
8pub 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}