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

Low hanging fruite lint do-over. #657

Closed
wants to merge 1 commit into from

Conversation

Ben-PH
Copy link

@Ben-PH Ben-PH commented Nov 16, 2024

Apologies if this comes across as low-effort. On potentially new projects, I like to turn on pedantic lints, and go through what comes out and see what little chores I can help with. It gives me a chance to familiarise my self with the projects contribution work flow, as well as get a start at looking at the code base.

The bulk of the lints are merging of the match statements.

There is also (according to the lint) a minor performance gain when using an &&str type: (*the_str).to_string() is better than the_str.to_string().

There are some other lints that promise to be minor micro-optimisations, but they change the interface (mostly about arguments being references vs owned).

If you want, I can also make changes to the private functions where clippy suggests these api changes.

@sharkdp
Copy link
Owner

sharkdp commented Nov 21, 2024

Thank you. It's not that it comes off as low-effort, but to be honest, it's also not a huge gain in most cases. And it introduces merge conflicts for a lot of open PRs.

I'm happy to accept PRs like this, but it would be great if you could maybe start with the things you think are most beneficial. And do maybe one lint per PR?

@Ben-PH
Copy link
Author

Ben-PH commented Nov 24, 2024

Sure thing. I won't take offense if you say that it's more effort than it's worth on your part, either. I'll break it down into bite-sized PRs. I'll add to lib.rs (commented out) #!(warn(clippy::...)] to indicate the lints (which can be taken out of the PR if you prefer).

@sharkdp sharkdp closed this Dec 27, 2024
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