mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-12 01:45:56 -05:00
[PR #2611] [MERGED] Add more clippy checks for better code/readability #6761
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/2611
Author: @BlackDex
Created: 7/10/2022
Status: ✅ Merged
Merged: 7/15/2022
Merged by: @dani-garcia
Base:
main← Head:more-clippy-checks📝 Commits (1)
55d7c48Add more clippy checks for better code/readability📊 Changes
12 files changed (+77 additions, -60 deletions)
View changed files
📝
src/api/admin.rs(+1 -1)📝
src/api/core/ciphers.rs(+6 -6)📝
src/api/core/emergency_access.rs(+2 -2)📝
src/api/core/sends.rs(+4 -4)📝
src/api/core/two_factor/authenticator.rs(+3 -3)📝
src/api/core/two_factor/yubikey.rs(+1 -1)📝
src/api/icons.rs(+23 -22)📝
src/db/models/device.rs(+5 -5)📝
src/db/models/send.rs(+1 -1)📝
src/db/models/user.rs(+1 -1)📝
src/main.rs(+27 -3)📝
src/util.rs(+3 -11)📄 Description
A bit inspired by @paolobarbolini from this commit at lettre https://github.com/lettre/lettre/pull/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_asyncare nice,which resulted in a few
asyncremovals.Some others are maybe a bit more estatic, like
string_to_string, but ithink it looks better to use
clonein those cases instead ofto_stringwhile they already are a string.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.