-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
clippy: Fix warnings in components/script/dom
& components/servo
#33853
Conversation
@@ -88,6 +88,7 @@ use crate::task_source::TaskSource; | |||
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)] | |||
pub struct GenerationId(u32); | |||
|
|||
#[allow(clippy::type_complexity)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be at the level of the whole struct
? Can we not have allow it just for past_names_map
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, I can do that. I wasn't sure if it'd make for cleaner code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to have it closer to the source of the warning, so we don't inadvertently allow new members of this struct with complex types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About the "cleaner code", I assume here you mean the visual noise from the allow
directive. I guess we can just add blank lines before and after the field (example) so it doesn't seem too "crammed".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay great! I'll add the blank lines :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but won't ./mach test-tidy
report errors after doing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it and it didn't.
Signed-off-by: taniishkaaa <[email protected]>
Signed-off-by: taniishkaaa <[email protected]>
Signed-off-by: taniishkaaa <[email protected]>
Signed-off-by: Mukilan Thiyagarajan <[email protected]>
Fixes warnings in
components/script/dom
&components/servo
as a part of #31500./mach build -d
does not report any errors./mach test-tidy
does not report any errors