[PR #1546] [MERGED] Run Clippy #2834

Closed
opened 2025-11-07 07:55:54 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/1546
Author: @RealOrangeOne
Created: 3/27/2021
Status: Merged
Merged: 3/28/2021
Merged by: @dani-garcia

Base: masterHead: clippy-run


📝 Commits (10+)

  • ea57dc3 Use matches macro
  • a8138be Use if let more
  • 9f1240d Only construct JSON object if it's useful
  • 6b1daeb Implement From over Into
  • 49af9cf Correctly camelCase acronyms
  • 47c2625 Prevent clippy complaining at method
  • 3e5971b Remove unnecessary result return types
  • 828a060 Run clippy on CI
  • da55d5e Also run actions CI on pull request
  • 0bf0125 Reverse negation on ordering

📊 Changes

18 files changed (+177 additions, -168 deletions)

View changed files

📝 .github/workflows/build.yml (+20 -1)
📝 src/api/admin.rs (+8 -8)
📝 src/api/core/accounts.rs (+8 -9)
📝 src/api/core/ciphers.rs (+7 -7)
📝 src/api/core/folders.rs (+3 -3)
📝 src/api/core/mod.rs (+11 -10)
📝 src/api/core/organizations.rs (+25 -25)
📝 src/api/core/two_factor/mod.rs (+3 -3)
📝 src/api/core/two_factor/u2f.rs (+5 -5)
📝 src/api/icons.rs (+7 -5)
📝 src/api/notifications.rs (+22 -20)
📝 src/auth.rs (+33 -33)
📝 src/db/models/cipher.rs (+1 -1)
📝 src/db/models/device.rs (+3 -3)
📝 src/db/models/organization.rs (+4 -16)
📝 src/error.rs (+5 -4)
📝 src/main.rs (+4 -7)
📝 src/util.rs (+8 -8)

📄 Description

Run clippy over the codebase, and fix the issues

https://github.com/rust-lang/rust-clippy

The diff is large, but the code is now nice and rust-y, and fixes some unwraps, unnecessary code and cleaner conditionals.

I intend to also do a PR for cargo fmt, but best get this one in first so it's easier to review.


🔄 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/1546 **Author:** [@RealOrangeOne](https://github.com/RealOrangeOne) **Created:** 3/27/2021 **Status:** ✅ Merged **Merged:** 3/28/2021 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `clippy-run` --- ### 📝 Commits (10+) - [`ea57dc3`](https://github.com/dani-garcia/vaultwarden/commit/ea57dc3bc9253b8db8e0815bac344f2cf981894b) Use `matches` macro - [`a8138be`](https://github.com/dani-garcia/vaultwarden/commit/a8138be69b0c051da9f97827a9f5427c98dd3051) Use `if let` more - [`9f1240d`](https://github.com/dani-garcia/vaultwarden/commit/9f1240d8d95eeb7fc17e746355cf6ace1577a4ee) Only construct JSON object if it's useful - [`6b1daeb`](https://github.com/dani-garcia/vaultwarden/commit/6b1daeba0533516c6d50fd2cebcc1e8060fd6df2) Implement `From` over `Into` - [`49af9cf`](https://github.com/dani-garcia/vaultwarden/commit/49af9cf4f5f8264384c7fa9063299f44e7536068) Correctly camelCase acronyms - [`47c2625`](https://github.com/dani-garcia/vaultwarden/commit/47c2625d38f902c200e083da4ea58fc40bfe3775) Prevent `clippy` complaining at method - [`3e5971b`](https://github.com/dani-garcia/vaultwarden/commit/3e5971b9dbfa0eabe69b682d848009741b435758) Remove unnecessary result return types - [`828a060`](https://github.com/dani-garcia/vaultwarden/commit/828a060698dba968e98064af90ffd8022b4d490e) Run clippy on CI - [`da55d5e`](https://github.com/dani-garcia/vaultwarden/commit/da55d5ec700dc430a8b75917ac9d4834b1f0ace8) Also run actions CI on pull request - [`0bf0125`](https://github.com/dani-garcia/vaultwarden/commit/0bf0125e8271e7c8449da50d0572de5147043ca7) Reverse negation on ordering ### 📊 Changes **18 files changed** (+177 additions, -168 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build.yml` (+20 -1) 📝 `src/api/admin.rs` (+8 -8) 📝 `src/api/core/accounts.rs` (+8 -9) 📝 `src/api/core/ciphers.rs` (+7 -7) 📝 `src/api/core/folders.rs` (+3 -3) 📝 `src/api/core/mod.rs` (+11 -10) 📝 `src/api/core/organizations.rs` (+25 -25) 📝 `src/api/core/two_factor/mod.rs` (+3 -3) 📝 `src/api/core/two_factor/u2f.rs` (+5 -5) 📝 `src/api/icons.rs` (+7 -5) 📝 `src/api/notifications.rs` (+22 -20) 📝 `src/auth.rs` (+33 -33) 📝 `src/db/models/cipher.rs` (+1 -1) 📝 `src/db/models/device.rs` (+3 -3) 📝 `src/db/models/organization.rs` (+4 -16) 📝 `src/error.rs` (+5 -4) 📝 `src/main.rs` (+4 -7) 📝 `src/util.rs` (+8 -8) </details> ### 📄 Description Run `clippy` over the codebase, and fix the issues https://github.com/rust-lang/rust-clippy The diff is large, but the code is now nice and rust-y, and fixes some `unwrap`s, unnecessary code and cleaner conditionals. I intend to also do a PR for `cargo fmt`, but best get this one in first so it's easier to review. --- <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 2025-11-07 07:55:54 -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#2834