[PR #2084] [MERGED] Macro recursion decrease and other optimizations #3053

Closed
opened 2026-03-03 09:25:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/2084
Author: @BlackDex
Created: 11/5/2021
Status: Merged
Merged: 11/6/2021
Merged by: @dani-garcia

Base: mainHead: minimize-macro-recursion


📝 Commits (1)

  • c453528 Macro recursion decrease and other optimizations

📊 Changes

17 files changed (+210 additions, -242 deletions)

View changed files

📝 Cargo.lock (+69 -100)
📝 Cargo.toml (+5 -5)
📝 docker/Dockerfile.j2 (+1 -1)
📝 docker/amd64/Dockerfile.alpine (+1 -1)
📝 docker/amd64/Dockerfile.buildx.alpine (+1 -1)
📝 rust-toolchain (+1 -1)
📝 src/api/admin.rs (+2 -3)
📝 src/api/core/accounts.rs (+2 -2)
📝 src/api/core/organizations.rs (+17 -45)
📝 src/api/notifications.rs (+2 -2)
📝 src/auth.rs (+0 -1)
📝 src/config.rs (+89 -64)
📝 src/db/models/two_factor.rs (+0 -1)
📝 src/error.rs (+1 -1)
📝 src/mail.rs (+5 -5)
📝 src/main.rs (+5 -1)
📝 src/util.rs (+9 -8)

📄 Description

  • Decreased recursion_limit from 512 to 87
    Mainly done by optimizing the config macro's.
    This fixes an issue with the rust-analyzer which doesn't go beyond 128
  • Removed Regex for masking sensitive values and replaced it with a map()
    This is much faster then using a Regex.
  • Refactored the get_support_json macro's
  • All items above also lowered the binary size and possibly compile-time
  • Removed _conn: DbConn from several functions, these caused unnecessary database connections for functions who didn't used that at all
  • Decreased json response for /plans
  • Updated libraries and where needed some code changes
    This also fixes some rare issues with SMTP https://github.com/lettre/lettre/issues/678
  • Using Rust 2021 instead of 2018
  • Updated rust nightly

🔄 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/2084 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 11/5/2021 **Status:** ✅ Merged **Merged:** 11/6/2021 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `minimize-macro-recursion` --- ### 📝 Commits (1) - [`c453528`](https://github.com/dani-garcia/vaultwarden/commit/c453528dc10d92c76776a7c96dd8de178a14cfff) Macro recursion decrease and other optimizations ### 📊 Changes **17 files changed** (+210 additions, -242 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+69 -100) 📝 `Cargo.toml` (+5 -5) 📝 `docker/Dockerfile.j2` (+1 -1) 📝 `docker/amd64/Dockerfile.alpine` (+1 -1) 📝 `docker/amd64/Dockerfile.buildx.alpine` (+1 -1) 📝 `rust-toolchain` (+1 -1) 📝 `src/api/admin.rs` (+2 -3) 📝 `src/api/core/accounts.rs` (+2 -2) 📝 `src/api/core/organizations.rs` (+17 -45) 📝 `src/api/notifications.rs` (+2 -2) 📝 `src/auth.rs` (+0 -1) 📝 `src/config.rs` (+89 -64) 📝 `src/db/models/two_factor.rs` (+0 -1) 📝 `src/error.rs` (+1 -1) 📝 `src/mail.rs` (+5 -5) 📝 `src/main.rs` (+5 -1) 📝 `src/util.rs` (+9 -8) </details> ### 📄 Description - Decreased `recursion_limit` from 512 to 87 Mainly done by optimizing the config macro's. This fixes an issue with the rust-analyzer which doesn't go beyond 128 - Removed Regex for masking sensitive values and replaced it with a map() This is much faster then using a Regex. - Refactored the get_support_json macro's - All items above also lowered the binary size and possibly compile-time - Removed `_conn: DbConn` from several functions, these caused unnecessary database connections for functions who didn't used that at all - Decreased json response for `/plans` - Updated libraries and where needed some code changes This also fixes some rare issues with SMTP https://github.com/lettre/lettre/issues/678 - Using Rust 2021 instead of 2018 - Updated rust nightly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:25:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#3053
No description provided.