1 #![allow( 2 clippy::unnecessary_operation, 3 clippy::single_match, 4 clippy::no_effect, 5 clippy::bool_to_int_with_if 6 )] main()7fn main() { 8 struct Test { 9 field: u32, 10 } 11 12 #[clippy::author] 13 Test { 14 field: if true { 1 } else { 0 }, 15 }; 16 17 let test = Test { field: 1 }; 18 19 match test { 20 #[clippy::author] 21 Test { field: 1 } => {}, 22 _ => {}, 23 } 24 25 struct TestTuple(u32); 26 27 let test_tuple = TestTuple(1); 28 29 match test_tuple { 30 #[clippy::author] 31 TestTuple(1) => {}, 32 _ => {}, 33 } 34 35 struct TestMethodCall(u32); 36 37 impl TestMethodCall { 38 fn test(&self) {} 39 } 40 41 let test_method_call = TestMethodCall(1); 42 43 #[clippy::author] 44 test_method_call.test(); 45 } 46