You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(clippy): satisfy needless_bool on Rust 1.100 - #1010
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:
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.
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.
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: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
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
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
Rust 1.100 extends
clippy::needless_boolto anif c { return true; }directly followed by a finalfalse. 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 ungatedapple_music_owns_playback()check moves from the firstifto 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, allFinishedwith no lint:--no-default-features --features telemetry,tui(slim)guileg's feature listtelemetry,tuiplus one oflocal-files,internet-radio,youtube,subsonic,qobuz(not CI legs; they check the single-feature tails)Local gate on 1.97:
cargo fmt --all -- --check: cleancargo clippy --no-default-features --features telemetry,tui -- -D warnings: Finishedcargo clippy --no-default-features --features telemetry -- -D warnings: Finishedcargo test --no-default-features --features telemetry,tui: 1912 passed, 0 failedcargo 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.rssite the gui leg covers.💬 Questions or want to chat with other contributors? Join the spotatui Discord.
Summary by CodeRabbit