-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions
Description
The following suggestion to add derive(Debug) does not take into consideration that line 170 already has another derive. It should suggest extending the existing derive instead of a new line:
warning: you should consider deriving a `Default` implementation for `policy::Attributes`
-->
|
176 | / pub fn new() -> Attributes {
177 | | Attributes {
178 | | map: HashMap::new(),
179 | | }
180 | | }
| |___^
|
= note: #[warn(new_without_default_derive)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#new_without_default_derive
help: try this
|
170 | #[derive(Default)]
|
Which when applying leads to having the following code:
169 | #[derive(Debug)]
170 | #[derive(Default)]
171 | struct Attributes {
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions