servo: Fix as many clippy problems as possible

Steps:

  1. Get Servo building and running locally following project documentation at http://github.com/servo/servo.
  2. Run ./mach cargo-clippy
  3. Fix an issue by understanding what the error means and correcting the issue. For instance
warning: redundant field names in struct initialization
   --> components/remutex/lib.rs:168:13
    |
168 |             data: data,
    |             ^^^^^^^^^^ help: replace it with: `data`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default
In this case `data: data` can just be replaced with `data`.
  1. Open an pull request with your fix, filling out the template, and giving it a full name like the following "clippy: Fix a redundant field warning in components/remutex/lib.rs.
  2. Include a link to this issue in your pull request description body.

As this issue is large enough to be worked on in parallel, please don't ask to assign it to yourself. If you want to post fixes for a particular section of code, just check the PRs linked here to make sure that you are fixing different issues.

NOTE: The warnings for missing safety documentation for unsafe code is already handled in PR #33748. Please ignore those.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (12 by maintainers)

Commits related to this issue

Most upvoted comments

With this last prs we are a bit closer to cleaning the clippy warnings. These should include every warning that is not part of script, excluding the same error type and safety comment issues as before. now that script is next, you can see that it contains all warnings created by codegen code, so that will be trickier.

This is due to https://github.com/servo/servo/pull/32208, you might need to do mach clean and mach bootstrap again (also make sure to have stable internet connection).