Skip to content
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

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

taniishkaaa
Copy link
Contributor

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
  • These changes are a part of Fix as many clippy problems as possible #31500
  • These changes do not require tests because they do not modify functionality

@@ -88,6 +88,7 @@ use crate::task_source::TaskSource;
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)]
pub struct GenerationId(u32);

#[allow(clippy::type_complexity)]
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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".

Copy link
Contributor Author

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 :)

Copy link
Contributor Author

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?

Copy link
Member

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: Mukilan Thiyagarajan <[email protected]>
@mukilan mukilan added this pull request to the merge queue Oct 16, 2024
Merged via the queue into servo:main with commit a646c85 Oct 16, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants