Skip to content

fix(clippy): satisfy needless_bool on Rust 1.100 - #1010

Merged
LargeModGames merged 1 commit into
mainfrom
fix/clippy-1-100-needless-bool
Nov 13, 2026
Merged

LargeModGames merged 1 commit into
mainfrom
fix/clippy-1-100-needless-bool

Conversation

@LargeModGames

@LargeModGames LargeModGames commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Rust 1.100 extends clippy::needless_bool to an if c { return true; } directly followed by a final false. Two functions on main take that shape once their #[cfg] blocks drop out, so every Clippy leg is red on main and on every open PR.

  • src/tui/ui/player.rs (non_spotify_source_playback_active): the ungated apple_music_owns_playback() check moves from the first if to the tail expression. In the slim build the function is now that one read. Slim, default, mcp-only and ai-dj-only failed here.
  • src/core/app/persistence.rs (has_persistable_playback): the radio check becomes a #[cfg(feature = "internet-radio")] tail with a #[cfg(not(...))] { false } arm. all-sources, gui, soloist and macOS failed here.

Both functions are pure reads, so the new order gives the same result on every feature set.

Testing

Clippy 1.100.0, -D warnings, all Finished with no lint:

  • --no-default-features --features telemetry,tui (slim)
  • default features
  • the gui leg's feature list
  • telemetry,tui plus one of local-files, internet-radio, youtube, subsonic, qobuz (not CI legs; they check the single-feature tails)

Local gate on 1.97:

  • cargo fmt --all -- --check: clean
  • cargo clippy --no-default-features --features telemetry,tui -- -D warnings: Finished
  • cargo clippy --no-default-features --features telemetry -- -D warnings: Finished
  • cargo test --no-default-features --features telemetry,tui: 1912 passed, 0 failed
  • cargo test --features all-sources: 2734 passed, 1 failed (infra::local::tests::uri_round_trip, which fails the same way on main on Windows)

Additional notes

Not run here: the soloist leg and the macOS job on 1.100. They hit the same persistence.rs site the gui leg covers.


💬 Questions or want to chat with other contributors? Join the spotatui Discord.

Summary by CodeRabbit

  • Bug Fixes
    • Playback persistence now reflects radio playback availability: radio playback is considered only when internet radio is enabled.
    • Playback status now checks decoded-source playback before reporting Apple Music as the active playback source, improving accuracy when these playback types overlap.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Playback persistence now checks radio playback only when internet-radio is enabled. Active-source detection checks decoded-source playback before returning the Apple Music ownership result.

Changes: Playback checks

Layer / File(s) Summary
Radio playback persistence
src/core/app/persistence.rs
The radio-playback check is compiled only when internet-radio is enabled. Without the feature, the check returns false.
Active-source detection
src/tui/ui/player.rs
The function checks feature-gated decoded-source playback before returning whether Apple Music owns playback.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Merge Risk: Minimal · up to 04aec

This change only restructures control flow so a newer Clippy version accepts it. Playback behavior is unchanged, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the conventional-commit prefix 'fix' with a scope 'clippy' and an imperative subject. It names the main change: satisfying the needless_bool Clippy lint on Rust 1.100. The changeset tou…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the conventional-commit prefix 'fix' with a scope 'clippy' and an imperative subject. It names the main change: satisfying the needless_bool Clippy lint on Rust 1.100. The changeset touches two functions to reorder feature-dependent control flow to satisfy that lint, so the title matches the main change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4c5fc99 and 04aec83.

Files selected for processing: 2

  • src/core/app/persistence.rs
  • src/tui/ui/player.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/core/app/persistence.rs 0.0% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit 7b2c1c1 into main Nov 13, 2026
39 checks passed
@LargeModGames
LargeModGames deleted the fix/clippy-1-100-needless-bool branch November 13, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant