Skip to content

Commit

Permalink
remove example
Browse files Browse the repository at this point in the history
  • Loading branch information
ahouts committed Dec 19, 2020
1 parent 1eb7608 commit a24c6f1
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions clippy_lints/src/needless_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ declare_clippy_lint! {
/// **What it does:** Checks for needlessly including a base struct on update
/// when all fields are changed anyway.
///
/// This lint is not applied to structs marked with
/// [non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html).
///
/// **Why is this bad?** This will cost resources (because the base has to be
/// somewhere), and make the code less readable.
///
Expand All @@ -21,14 +24,7 @@ declare_clippy_lint! {
/// # z: i32,
/// # }
/// # let zero_point = Point { x: 0, y: 0, z: 0 };
/// #
/// # #[non_exhaustive]
/// # struct Options {
/// # a: bool,
/// # b: i32,
/// # }
/// # let default_options = Options { a: false, b: 0 };
/// #
///
/// // Bad
/// Point {
/// x: 1,
Expand All @@ -43,14 +39,6 @@ declare_clippy_lint! {
/// y: 1,
/// ..zero_point
/// };
///
/// // this lint is not applied to structs marked with [non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html)
/// // Ok
/// Options {
/// a: true,
/// b: 321,
/// ..default_options
/// };
/// ```
pub NEEDLESS_UPDATE,
complexity,
Expand Down

0 comments on commit a24c6f1

Please sign in to comment.