]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/author/struct.rs
Auto merge of #97944 - nikic:freebsd-update, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / author / struct.rs
1 #[allow(clippy::unnecessary_operation, clippy::single_match)]
2 fn main() {
3     struct Test {
4         field: u32,
5     }
6
7     #[clippy::author]
8     Test {
9         field: if true { 1 } else { 0 },
10     };
11
12     let test = Test { field: 1 };
13
14     match test {
15         #[clippy::author]
16         Test { field: 1 } => {},
17         _ => {},
18     }
19
20     struct TestTuple(u32);
21
22     let test_tuple = TestTuple(1);
23
24     match test_tuple {
25         #[clippy::author]
26         TestTuple(1) => {},
27         _ => {},
28     }
29
30     struct TestMethodCall(u32);
31
32     impl TestMethodCall {
33         fn test(&self) {}
34     }
35
36     let test_method_call = TestMethodCall(1);
37
38     #[clippy::author]
39     test_method_call.test();
40 }