Skip to content

Commit a24c6f1

Browse files
committed
remove example
1 parent 1eb7608 commit a24c6f1

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

clippy_lints/src/needless_update.rs

+4-16
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ declare_clippy_lint! {
88
/// **What it does:** Checks for needlessly including a base struct on update
99
/// when all fields are changed anyway.
1010
///
11+
/// This lint is not applied to structs marked with
12+
/// [non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html).
13+
///
1114
/// **Why is this bad?** This will cost resources (because the base has to be
1215
/// somewhere), and make the code less readable.
1316
///
@@ -21,14 +24,7 @@ declare_clippy_lint! {
2124
/// # z: i32,
2225
/// # }
2326
/// # 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+
///
3228
/// // Bad
3329
/// Point {
3430
/// x: 1,
@@ -43,14 +39,6 @@ declare_clippy_lint! {
4339
/// y: 1,
4440
/// ..zero_point
4541
/// };
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-
/// };
5442
/// ```
5543
pub NEEDLESS_UPDATE,
5644
complexity,

0 commit comments

Comments
 (0)