diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/branches_sharing_code/false_positives.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui/branches_sharing_code/false_positives.rs b/tests/ui/branches_sharing_code/false_positives.rs new file mode 100644 index 00000000000..7f42df46341 --- /dev/null +++ b/tests/ui/branches_sharing_code/false_positives.rs @@ -0,0 +1,28 @@ +#![allow(dead_code)] +#![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] + +// ################################## +// # Issue clippy#7369 +// ################################## +#[derive(Debug)] +pub struct FooBar { + foo: Vec<u32>, +} + +impl FooBar { + pub fn bar(&mut self) { + if true { + self.foo.pop(); + } else { + self.baz(); + + self.foo.pop(); + + self.baz() + } + } + + fn baz(&mut self) {} +} + +fn main() {} |
