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

Add more clippy checks for better code/readability #2611

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

BlackDex
Copy link
Collaborator

A bit inspired by @paolobarbolini from this commit at lettre lettre/lettre#784 .
I added a few more clippy lints here, and fixed the resulted issues.

Overall i think this could help in preventing future issues, and maybe
even peformance problems. It also makes some code a bit more clear.

We could always add more if we want to, i left a few out which i think
arn't that huge of an issue. Some like the unused_async are nice,
which resulted in a few async removals.

Some others are maybe a bit more estatic, like string_to_string, but i
think it looks better to use clone in those cases instead of to_string while they already are a string.

A bit inspired by @paolobarbolini from this commit at lettre lettre/lettre#784 .
I added a few more clippy lints here, and fixed the resulted issues.

Overall i think this could help in preventing future issues, and maybe
even peformance problems. It also makes some code a bit more clear.

We could always add more if we want to, i left a few out which i think
arn't that huge of an issue. Some like the `unused_async` are nice,
which resulted in a few `async` removals.

Some others are maybe a bit more estatic, like `string_to_string`, but i
think it looks better to use `clone` in those cases instead of `to_string` while they already are a string.
@BlackDex
Copy link
Collaborator Author

Let me know what you think of this, i have left out string_add for example, since i do not mind the x + "some-string" my self. But that is more a personal preference. We can always add/remove others if we want to make it more/less strict.

@dani-garcia dani-garcia merged commit e167798 into dani-garcia:main Jul 15, 2022
@dani-garcia
Copy link
Owner

So far I agree 100% with those changes, yeah!

@BlackDex BlackDex deleted the more-clippy-checks branch July 16, 2022 08:19
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