]>
Commit | Line | Data |
---|---|---|
136023e0 XL |
1 | #![allow(dead_code)] |
2 | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] | |
3 | ||
4 | // ################################## | |
5 | // # Issue clippy#7369 | |
6 | // ################################## | |
7 | #[derive(Debug)] | |
8 | pub struct FooBar { | |
9 | foo: Vec<u32>, | |
10 | } | |
11 | ||
12 | impl FooBar { | |
13 | pub fn bar(&mut self) { | |
14 | if true { | |
15 | self.foo.pop(); | |
16 | } else { | |
17 | self.baz(); | |
18 | ||
19 | self.foo.pop(); | |
20 | ||
21 | self.baz() | |
22 | } | |
23 | } | |
24 | ||
25 | fn baz(&mut self) {} | |
26 | } | |
27 | ||
923072b8 FG |
28 | fn foo(x: u32, y: u32) -> u32 { |
29 | x / y | |
30 | } | |
31 | ||
32 | fn main() { | |
33 | let x = (1, 2); | |
34 | let _ = if true { | |
35 | let (x, y) = x; | |
36 | foo(x, y) | |
37 | } else { | |
38 | let (y, x) = x; | |
39 | foo(x, y) | |
40 | }; | |
41 | } |