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 redundant_* warnings #32056

Merged
merged 3 commits into from
Apr 11, 2024
Merged

Conversation

eerii
Copy link
Contributor

@eerii eerii commented Apr 11, 2024

Fixes redundant_* clippy warnings. Also updates the spec comments in the files changed to be propper rustdoc.

  • redundant_file_names: Removes duplicate field names in struct initialization to avoid.
  • redundant_closure: Functions can be passed directly instead of wrapping them in a closure.
  • redundant_pattern_matching: is_ok and is_err can be used instead. Here the only part I'm unsure is what to do about the steps in components/script/dom/url.rs, since this merges step 2.2 and 3 together.
  • redundant_guards: The pattern can be added directly to the Some(...) pattern instead of checked with an extra if.

  • ./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 don't modify behaviour

@eerii eerii changed the title clippy: Fix redundant_field_names warnings clippy: Fix redundant_* warnings Apr 11, 2024
Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jdm jdm added this pull request to the merge queue Apr 11, 2024
Merged via the queue into servo:main with commit b3d9924 Apr 11, 2024
10 checks passed
@eerii eerii deleted the clippy_redundant_field_names branch April 12, 2024 09:59
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.

None yet

2 participants