GCWing / GCWing/OpenBitFun

[Bug]: stale allow(unused_mut) on the main window builder hides future regressions

Offen Anfängerfreundlich
#2,582 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
2.2k
Forks
229
Ø Merge
2 Std. 46 Min.
Gemergte PRs (30 T.)
577

Beschreibung

**Summary**

The main window creation path in the desktop crate carries an `#[allow(unused_mut)]` attribute that can never fire, and it silently suppresses the compiler check for that binding.

`src/apps/desktop/src/appearance.rs:578` marks the main window builder binding with `#[allow(unused_mut)]`. Removing the attribute changes nothing: the binding's mutability is genuinely consumed on every platform, so the suppression has no warning to silence — it is permanently inert.

The binding is unconditionally reassigned via `builder.disable_drag_drop_handler()` (appearance.rs:610) on all platforms, with further reassignments in the `#[cfg(target_os = "macos")]` and `#[cfg(target_os = "windows")]` blocks (:617-629). Because the `mut` requirement is satisfied unconditionally, the `allow` attribute can never trigger — but as long as it sits on the binding, any future regression that actually removes all mutating uses would be silently swallowed instead of reported.

**Area**

Desktop app

**Reproduction or evidence**

1. Delete the `#[allow(unused_mut)]` line at appearance.rs:578 on main.
2. Run `cargo check --release -p bitfun-desktop`.
3. Observe: no new warning appears for `appearance.rs` — confirming the allow was suppressing nothing.

A deletion-only fix (remove the attribute) is ready to submit; it restores the lint's coverage for this binding at zero behavior cost. PR to follow referencing this issue.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Open src/apps/desktop/src/appearance.rs at the main window builder around lines 578-629 and inspect the unconditional and platform-specific reassignments. Remove the stale allow attribute, then run cargo check --release -p bitfun-desktop. Done means the check passes without a new warning and the builder behavior remains unchanged.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
desktop
Issue-Typ
Bug
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
92/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.