]> git.lizzy.rs Git - rust.git/blob - tests/ui/branches_sharing_code/false_positives.rs
Auto merge of #7847 - mikerite:fix-7829, r=flip1995
[rust.git] / tests / ui / branches_sharing_code / false_positives.rs
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
28 fn main() {}