File tree 1 file changed +4
-16
lines changed
1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ declare_clippy_lint! {
8
8
/// **What it does:** Checks for needlessly including a base struct on update
9
9
/// when all fields are changed anyway.
10
10
///
11
+ /// This lint is not applied to structs marked with
12
+ /// [non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html).
13
+ ///
11
14
/// **Why is this bad?** This will cost resources (because the base has to be
12
15
/// somewhere), and make the code less readable.
13
16
///
@@ -21,14 +24,7 @@ declare_clippy_lint! {
21
24
/// # z: i32,
22
25
/// # }
23
26
/// # let zero_point = Point { x: 0, y: 0, z: 0 };
24
- /// #
25
- /// # #[non_exhaustive]
26
- /// # struct Options {
27
- /// # a: bool,
28
- /// # b: i32,
29
- /// # }
30
- /// # let default_options = Options { a: false, b: 0 };
31
- /// #
27
+ ///
32
28
/// // Bad
33
29
/// Point {
34
30
/// x: 1,
@@ -43,14 +39,6 @@ declare_clippy_lint! {
43
39
/// y: 1,
44
40
/// ..zero_point
45
41
/// };
46
- ///
47
- /// // this lint is not applied to structs marked with [non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html)
48
- /// // Ok
49
- /// Options {
50
- /// a: true,
51
- /// b: 321,
52
- /// ..default_options
53
- /// };
54
42
/// ```
55
43
pub NEEDLESS_UPDATE ,
56
44
complexity,
You can’t perform that action at this time.
0 commit comments