[PR #7143] [MERGED] Apply ref_option lint findings #24763

Closed
opened 2026-05-22 02:24:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/7143
Author: @dfunkt
Created: 4/27/2026
Status: Merged
Merged: 4/28/2026
Merged by: @BlackDex

Base: mainHead: ref-option-lint


📝 Commits (1)

  • ad41c45 Apply ref_option lint findings

📊 Changes

10 files changed (+54 additions, -53 deletions)

View changed files

📝 Cargo.toml (+1 -0)
📝 src/api/admin.rs (+1 -1)
📝 src/api/core/accounts.rs (+9 -9)
📝 src/api/core/ciphers.rs (+7 -7)
📝 src/api/core/mod.rs (+1 -1)
📝 src/api/core/organizations.rs (+2 -2)
📝 src/api/identity.rs (+27 -27)
📝 src/api/notifications.rs (+1 -1)
📝 src/api/push.rs (+2 -2)
📝 src/config.rs (+3 -3)

📄 Description

Quote from the lint description:
"More flexibility, better memory optimization, and more idiomatic Rust code.

&Option in a function signature breaks encapsulation because the caller must own T and move it into an Option to call with it. When returned, the owner must internally store it as Option in order to return it. At a lower level, &Option points to memory with the presence bit flag plus the T value, whereas Option<&T> is usually optimized to a single pointer, so it may be more optimal."


🔄 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/7143 **Author:** [@dfunkt](https://github.com/dfunkt) **Created:** 4/27/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@BlackDex](https://github.com/BlackDex) **Base:** `main` ← **Head:** `ref-option-lint` --- ### 📝 Commits (1) - [`ad41c45`](https://github.com/dani-garcia/vaultwarden/commit/ad41c45214e6a79d823d3d3b2f0ccc7b3e28b01d) Apply `ref_option` lint findings ### 📊 Changes **10 files changed** (+54 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+1 -0) 📝 `src/api/admin.rs` (+1 -1) 📝 `src/api/core/accounts.rs` (+9 -9) 📝 `src/api/core/ciphers.rs` (+7 -7) 📝 `src/api/core/mod.rs` (+1 -1) 📝 `src/api/core/organizations.rs` (+2 -2) 📝 `src/api/identity.rs` (+27 -27) 📝 `src/api/notifications.rs` (+1 -1) 📝 `src/api/push.rs` (+2 -2) 📝 `src/config.rs` (+3 -3) </details> ### 📄 Description Quote from the lint description: "More flexibility, better memory optimization, and more idiomatic Rust code. &Option<T> in a function signature breaks encapsulation because the caller must own T and move it into an Option to call with it. When returned, the owner must internally store it as Option<T> in order to return it. At a lower level, &Option<T> points to memory with the presence bit flag plus the T value, whereas Option<&T> is usually optimized to a single pointer, so it may be more optimal." --- <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-05-22 02:24:32 -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#24763