[PR #7200] [MERGED] Switch to Edition 2024, more clippy lints, and less macro calls #31561

Closed
opened 2026-06-17 11:33:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/7200
Author: @BlackDex
Created: 5/8/2026
Status: Merged
Merged: 5/17/2026
Merged by: @dani-garcia

Base: mainHead: edition-2024-and-other-stuff


📝 Commits (3)

  • 83317d9 Update to Rust 2024 Edition
  • b3861e8 Reorder and merge imports
  • 95c413d Remove "db_run!" macro calls where possible

📊 Changes

61 files changed (+3337 additions, -3072 deletions)

View changed files

📝 Cargo.toml (+114 -55)
📝 build.rs (+4 -6)
📝 macros/src/lib.rs (+5 -4)
📝 rustfmt.toml (+1 -1)
📝 src/api/admin.rs (+64 -69)
📝 src/api/core/accounts.rs (+73 -77)
📝 src/api/core/ciphers.rs (+108 -114)
📝 src/api/core/emergency_access.rs (+28 -24)
📝 src/api/core/events.rs (+54 -60)
📝 src/api/core/folders.rs (+5 -4)
📝 src/api/core/mod.rs (+48 -38)
📝 src/api/core/organizations.rs (+134 -132)
📝 src/api/core/public.rs (+60 -63)
📝 src/api/core/sends.rs (+34 -32)
📝 src/api/core/two_factor/authenticator.rs (+11 -11)
📝 src/api/core/two_factor/duo.rs (+16 -17)
📝 src/api/core/two_factor/duo_oidc.rs (+21 -23)
📝 src/api/core/two_factor/email.rs (+20 -20)
📝 src/api/core/two_factor/mod.rs (+14 -21)
📝 src/api/core/two_factor/protected_actions.rs (+16 -10)

...and 41 more files

📄 Description

  • Changed to 2024 Edition of Rust
  • Added a lot more Clippy lints and fixed them, this should help prevent some possible issues and make our code base a bit more idiomatic Rust. Allowed a few noisy once for now, that might change in the future.
  • Removed a lot of db_run! macro calls. While this doesn't seem to provide any speed in compiling, it does make that code now being able to be formatted using cargo fmt.
  • Reordered all crate includes and removed wildcard imports, as these could cause possible issues.
  • Removed all functions and variables starting with a _ which are really used, in Rust an _ should only be used if that function or variable is not used, or should be ignored but is needed for some reason, like we do sometimes to apply HTTP Guards, but never use those guards inside the function it self.

🔄 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/7200 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 5/8/2026 **Status:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `edition-2024-and-other-stuff` --- ### 📝 Commits (3) - [`83317d9`](https://github.com/dani-garcia/vaultwarden/commit/83317d90b7201779ca76fccbc93a45903a6d5ca9) Update to Rust 2024 Edition - [`b3861e8`](https://github.com/dani-garcia/vaultwarden/commit/b3861e876588202b8fd9976f969706ead062d51d) Reorder and merge imports - [`95c413d`](https://github.com/dani-garcia/vaultwarden/commit/95c413d58dacea2659ad818007f16d4c91ec7220) Remove "db_run!" macro calls where possible ### 📊 Changes **61 files changed** (+3337 additions, -3072 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+114 -55) 📝 `build.rs` (+4 -6) 📝 `macros/src/lib.rs` (+5 -4) 📝 `rustfmt.toml` (+1 -1) 📝 `src/api/admin.rs` (+64 -69) 📝 `src/api/core/accounts.rs` (+73 -77) 📝 `src/api/core/ciphers.rs` (+108 -114) 📝 `src/api/core/emergency_access.rs` (+28 -24) 📝 `src/api/core/events.rs` (+54 -60) 📝 `src/api/core/folders.rs` (+5 -4) 📝 `src/api/core/mod.rs` (+48 -38) 📝 `src/api/core/organizations.rs` (+134 -132) 📝 `src/api/core/public.rs` (+60 -63) 📝 `src/api/core/sends.rs` (+34 -32) 📝 `src/api/core/two_factor/authenticator.rs` (+11 -11) 📝 `src/api/core/two_factor/duo.rs` (+16 -17) 📝 `src/api/core/two_factor/duo_oidc.rs` (+21 -23) 📝 `src/api/core/two_factor/email.rs` (+20 -20) 📝 `src/api/core/two_factor/mod.rs` (+14 -21) 📝 `src/api/core/two_factor/protected_actions.rs` (+16 -10) _...and 41 more files_ </details> ### 📄 Description - Changed to 2024 Edition of Rust - Added a lot more Clippy lints and fixed them, this should help prevent some possible issues and make our code base a bit more idiomatic Rust. Allowed a few noisy once for now, that might change in the future. - Removed a lot of `db_run!` macro calls. While this doesn't seem to provide any speed in compiling, it does make that code now being able to be formatted using `cargo fmt`. - Reordered all crate includes and removed wildcard imports, as these could cause possible issues. - Removed all functions and variables starting with a `_` which are really used, in Rust an `_` should only be used if that function or variable is not used, or should be ignored but is needed for some reason, like we do sometimes to apply HTTP Guards, but never use those guards inside the function it self. --- <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-06-17 11:33:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#31561