remove example
This commit is contained in:
parent
1eb7608a2e
commit
a24c6f14fa
1 changed files with 4 additions and 16 deletions
|
@ -8,6 +8,9 @@ declare_clippy_lint! {
|
||||||
/// **What it does:** Checks for needlessly including a base struct on update
|
/// **What it does:** Checks for needlessly including a base struct on update
|
||||||
/// when all fields are changed anyway.
|
/// 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
|
/// **Why is this bad?** This will cost resources (because the base has to be
|
||||||
/// somewhere), and make the code less readable.
|
/// somewhere), and make the code less readable.
|
||||||
///
|
///
|
||||||
|
@ -21,14 +24,7 @@ declare_clippy_lint! {
|
||||||
/// # z: i32,
|
/// # z: i32,
|
||||||
/// # }
|
/// # }
|
||||||
/// # let zero_point = Point { x: 0, y: 0, z: 0 };
|
/// # 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
|
/// // Bad
|
||||||
/// Point {
|
/// Point {
|
||||||
/// x: 1,
|
/// x: 1,
|
||||||
|
@ -43,14 +39,6 @@ declare_clippy_lint! {
|
||||||
/// y: 1,
|
/// y: 1,
|
||||||
/// ..zero_point
|
/// ..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,
|
pub NEEDLESS_UPDATE,
|
||||||
complexity,
|
complexity,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue