Skip to content

Move unnecessary_struct_initialization to nursery #10552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions clippy_lints/src/unnecessary_struct_initialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare_clippy_lint! {
/// any field.
///
/// ### Why is this bad?
/// Readibility suffers from unnecessary struct building.
/// Readability suffers from unnecessary struct building.
///
/// ### Example
/// ```rust
Expand All @@ -25,9 +25,13 @@ declare_clippy_lint! {
/// let a = S { s: String::from("Hello, world!") };
/// let b = a;
/// ```
///
/// ### Known Problems
/// Has false positives when the base is a place expression that cannot be
/// moved out of, see [#10547](https://github.com/rust-lang/rust-clippy/issues/10547).
#[clippy::version = "1.70.0"]
pub UNNECESSARY_STRUCT_INITIALIZATION,
complexity,
nursery,
"struct built from a base that can be written mode concisely"
}
declare_lint_pass!(UnnecessaryStruct => [UNNECESSARY_STRUCT_INITIALIZATION]);
Expand Down