Release builds emit an unused_mut warning in app-server
Open 💬 0 comments Opened Jul 14, 2026 by GhostBoyBoy
What issue are you seeing?
Building codex-app-server in release mode emits an unused_mut warning:
warning: variable does not need to be mutable
--> app-server/src/lib.rs:1297:5
|
1297 | mut loader_overrides: LoaderOverrides,
| ----^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
What steps can reproduce the bug?
- Clone the repository.
- Enter the Rust workspace:
cd codex-rs
- Build app-server in release mode:
cargo build --release -p codex-app-server
What is the expected behavior?
Release builds should complete without an unused_mut warning, while debug
builds should continue allowing loader_overrides.user_config_path to be
modified.
A minimal possible fix is to allow this lint only when debug assertions are
disabled:
#[cfg_attr(not(debug_assertions), allow(unused_mut))]
fn loader_overrides_with_test_user_config_file(
mut loader_overrides: LoaderOverrides,
test_user_config_file: Option<std::path::PathBuf>,
) -> IoResult<LoaderOverrides> {
// ...
}
Additional information
I have tested this change locally and can submit a focused one-line pull request
if a maintainer considers this approach appropriate and invites the
contribution.
Proposed fix commit:
https://github.com/GhostBoyBoy/codex/commit/30267fd50e