fix(desktop): drop stale unused_mut allow - #2584
Open
1688mengdie wants to merge 1 commit into
Open
Conversation
The main window builder binding in appearance.rs carries an #[allow(unused_mut)] attribute, but the allow can never fire: the builder is unconditionally reassigned via disable_drag_drop_handler() on every platform, with further conditional reassignments in the macos and windows cfg blocks. With the mutability genuinely consumed on all targets, the suppression is dead weight that hides future regressions. Remove the attribute; the binding and all consumers are unchanged. Test: cargo check --release -p bitfun-desktop --jobs 4 (0 errors 0 warnings; no new warning surfaces after removal) Test: cargo check -p bitfun-desktop (dev profile, 0 errors 0 warnings) AI: This commit was authored with AI assistance; checks were run locally on Windows (release + dev profiles) and non-Windows compilation surfaces are to be confirmed by the upstream multi-OS CI matrix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The main window builder binding in
appearance.rscarries an#[allow(unused_mut)]attribute, but the allow can never fire: the builder is unconditionally reassigned viadisable_drag_drop_handler()on every platform (appearance.rs:610), with further reassignments in the macos and windows cfg blocks. With the mutability genuinely consumed on all targets, the suppression is dead weight that hides future regressions — if a later change ever removed all mutating uses of this binding, the attribute would silence theunused_mutwarning that should have caught it. This PR deletes the attribute; the binding and all consumers are unchanged.Fixes #2582
Type and Areas
Type: Bug fix
Areas: Rust core (desktop, main window lifecycle)
Motivation / Impact
An inert
#[allow]on a hot path like main window creation is not cosmetic: it disables a compiler check for that binding indefinitely. Removing it restores the check's coverage at zero behavior cost — the attribute provably has nothing to suppress today (removing it surfaces no warning on any profile we can run), so the change is semantics-free while re-arming the lint for future regressions.Verification
Scope note (assertion form): this branch is based on main, which carries one pre-existing
unused_mutwarning insrc/apps/desktop/src/api/browser_api.rs:145(fixed by a separate PR). The assertion for this change is therefore "zero warnings for the touched binding/file + no new warnings beyond that known pre-existing one", not a bare "0 warnings":cargo check --release -p bitfun-desktop --jobs 4with this branch: exits 0; the only reported warning is the pre-existingbrowser_api.rs:145one from main —appearance.rssurfaces nothing after the attribute removal.cargo check -p bitfun-desktop --jobs 4(dev profile): 0 errors, 0 warnings.AI-assisted change, lightly tested.
Reviewer Notes
builder.build()are untouched, so there is no behavior change on any platform.unused_mutis armed again for this binding. If reviewers prefer, an alternative is restructuring the builder chain, but the attribute removal is the minimal, semantics-free fix.Checklist