remove example

This commit is contained in:
Andrew Houts 2020-12-18 19:15:05 -06:00
parent 1eb7608a2e
commit a24c6f14fa

View File

@ -8,6 +8,9 @@
/// **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.
///
@ -21,14 +24,7 @@
/// # 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,
@ -43,14 +39,6 @@
/// 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,