Skip to content

Conversation

@Morcifer
Copy link
Contributor

This PR resolves issue #2276.

There were several straightforward lints that made perfect sense to fix (e.g. adding the must_use and the backticks).

But there were a few that I wasn't sure about:

  • too_many_lines: For these, I preferred to allow it rather than fix it. For the tests, I think that's the right approach. For the apply_rules, it's because I think the method is more readable as a very long function, especially given that it's the match statement that's taking up most of the lines.
  • match_same_arms: This one also relates to apply_rules. My opinion is that completely fixing the branches ends up going from many straightforward conditions to less (but still many) complicated conditions. So I fixed some of the arms but then disabled the lint for the rest. If you want, I can fix the rest of the arms instead.
  • trivially_copy_pass_by_ref: I'm not 100% sure I agree with removing the reference and using a copy instead, but clippy probably knows much better than me, so I listened to it and changed the function parameters from &TokenKind and &Keyword to TokenKind or Keyword.

Copy link
Collaborator

@swernli swernli left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Copy link
Contributor

@ScottCarda-MS ScottCarda-MS left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@swernli swernli added this pull request to the merge queue Apr 28, 2025
Merged via the queue into microsoft:main with commit a717cb7 Apr 28, 2025
18 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.

3 participants