[PR #7199] [CLOSED] Add redundant_else clippy lint #23429

Closed
opened 2026-05-16 06:00:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/7199
Author: @taylortumlin
Created: 5/8/2026
Status: Closed

Base: mainHead: feature/lint-redundant-else


📝 Commits (1)

  • def93ae Add redundant_else clippy lint

📊 Changes

7 files changed (+20 additions, -27 deletions)

View changed files

📝 Cargo.toml (+1 -0)
📝 src/api/admin.rs (+1 -2)
📝 src/api/core/organizations.rs (+5 -6)
📝 src/config.rs (+1 -2)
📝 src/db/mod.rs (+6 -7)
📝 src/db/models/cipher.rs (+2 -4)
📝 src/mail.rs (+4 -6)

📄 Description

What

Adds redundant_else = "deny" to the workspace clippy lint list and removes the 8 existing redundant_else violations.

Why

Continues the pattern of incrementally adopting useful clippy lints (e.g. PRs #7143, #7144 added ref_option and duration_suboptimal_units). The lint catches else blocks following if arms that always diverge — they add nesting without adding meaning.

Testing

  • cargo fmt --check
  • cargo test --features sqlite,mysql,postgresql
  • cargo clippy --features sqlite,mysql,postgresql -- -D warnings
  • All pre-commit hooks pass.

Notes

One non-mechanical edit: in src/db/mod.rs, clippy's auto-fix left a // Sqlite section-comment stranded inside the postgresql arm. Moved it to sit above the #[cfg(sqlite)] block where it belongs.


🔄 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/7199 **Author:** [@taylortumlin](https://github.com/taylortumlin) **Created:** 5/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/lint-redundant-else` --- ### 📝 Commits (1) - [`def93ae`](https://github.com/dani-garcia/vaultwarden/commit/def93ae78f0605a884cbb5db992032b5d0c4b290) Add redundant_else clippy lint ### 📊 Changes **7 files changed** (+20 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+1 -0) 📝 `src/api/admin.rs` (+1 -2) 📝 `src/api/core/organizations.rs` (+5 -6) 📝 `src/config.rs` (+1 -2) 📝 `src/db/mod.rs` (+6 -7) 📝 `src/db/models/cipher.rs` (+2 -4) 📝 `src/mail.rs` (+4 -6) </details> ### 📄 Description ## What Adds `redundant_else = "deny"` to the workspace clippy lint list and removes the 8 existing `redundant_else` violations. ## Why Continues the pattern of incrementally adopting useful clippy lints (e.g. PRs #7143, #7144 added `ref_option` and `duration_suboptimal_units`). The lint catches `else` blocks following `if` arms that always diverge — they add nesting without adding meaning. ## Testing - `cargo fmt --check` - `cargo test --features sqlite,mysql,postgresql` - `cargo clippy --features sqlite,mysql,postgresql -- -D warnings` - All pre-commit hooks pass. ## Notes One non-mechanical edit: in `src/db/mod.rs`, clippy's auto-fix left a `// Sqlite` section-comment stranded inside the postgresql arm. Moved it to sit above the `#[cfg(sqlite)]` block where it belongs. --- <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-16 06:00:34 -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#23429