[PR #2611] [MERGED] Add more clippy checks for better code/readability #6761

Closed
opened 2026-03-07 21:04:36 -06:00 by GiteaMirror · 0 comments
Owner

📋 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: mainHead: more-clippy-checks


📝 Commits (1)

  • 55d7c48 Add 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_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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/2611 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 7/10/2022 **Status:** ✅ Merged **Merged:** 7/15/2022 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `more-clippy-checks` --- ### 📝 Commits (1) - [`55d7c48`](https://github.com/dani-garcia/vaultwarden/commit/55d7c48b1da23770d8152724ad8b6c733739e64d) Add more clippy checks for better code/readability ### 📊 Changes **12 files changed** (+77 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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_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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-07 21:04:36 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#6761