-
Notifications
You must be signed in to change notification settings - Fork 440
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 fixes #1129
base: master
Are you sure you want to change the base?
Clippy fixes #1129
Conversation
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.
Nice, thanks!
I don't usually run Clippy because there's a lot I disagree with, and just don't have the time to sit down and configure the lint list to reflect my taste. (And also don't like littering code with allow(..)
annotations on a case-by-case basis.)
With that said, I actually agree with most of these. There are a few that I would like to see reverted, but most look good. Part of the reason there are a lot is because regex-automata
went through several rather large revisions while I worked on it, and not all code got thoroughly refactored. (That explains things like superfluous ref
bindings and unnecessary clone
calls.) And then of course, regex-automata
's MSRV was much lower than what it is now compared to when I started.
Hopefully 1.74's new change regarding cargo based lint configurations might change your mind. If this is accepted I'll work on the others while being mindful of your comments here as well. |
The new support in Cargo is great, but it doesn't really change my calculus here. And indeed, at least for a lot of my crates, we'd need to be mindful of MSRV. (It's possible it won't matter, for example, if Cargo will just ignore that section otherwise.) Basically, you still have to go through and figure out which lints to use and then go and apply them to all of the projects. I would have had to do that before and I would still have to do that today. I'll try to be a bit clearer here... I personally do not want to have several dozen PRs scattered throughout all of my projects for setting up lint configurations right now. In part because I don't actually know whether I'll go through with it, so I don't want you to spend all that effort on it. Namely, the key thing that can't be addressed by any amount of work or configuration is that Clippy will invariably lead to adding If my projects had a lot more contributors or multiple active maintainers then I would very likely feel differently about this. |
I understand what you are saying. I have reverted the issues you mentioned in this PR, are there any further changes you'd like to see? |
Currently, the default
cargo clippy
shows a lot of potential fixes.I've prepared a potential initial batch that could be applied.
There are more, and if this PR merges I shall prepare them further.
Most are one liner changes employing clippy suggestions with adjustments as necessary.