Compiler warning in cf_opts.rs when building in --release #1621

Closed
opened 2026-04-07 01:05:17 +00:00 by ezera · 0 comments
Contributor

Running cargo clippy --release --workspace --locked --no-deps -- -D warnings results in this warning (not present in the debug build):

error: variable does not need to be mutable
  --> src/database/engine/cf_opts.rs:73:6
   |
73 |     let mut opts = opts
   |         ----^^^^
   |         |
   |         help: remove this `mut`
   |
   = note: `-D unused-mut` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_mut)]`

This can be easily fixed by only declaring opts as mutable inside the following cfg block that checks we're building with debug assertions.

I have put up a PR that fixes this warning: #1620

This warning was initially found by ggdev.

Running `cargo clippy --release --workspace --locked --no-deps -- -D warnings` results in this warning (not present in the debug build): ```rust error: variable does not need to be mutable --> src/database/engine/cf_opts.rs:73:6 | 73 | let mut opts = opts | ----^^^^ | | | help: remove this `mut` | = note: `-D unused-mut` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_mut)]` ``` This can be easily fixed by only declaring `opts` as mutable inside [the following `cfg` block](https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/8b762cf2e6359e2a29cfe10e852dbfce31cfbd6c/src/database/engine/cf_opts.rs#L77) that checks we're building with debug assertions. I have put up a PR that fixes this warning: #1620 This warning was initially found by ggdev.
ezera changed title from Compiler warning when building in --release to Compiler warning in cf_opts.rs when building in --release 2026-04-07 01:05:36 +00:00
nex closed this issue 2026-04-07 12:58:24 +00: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
continuwuation/continuwuity#1621
No description provided.