refactor(workspace): sweep low-risk clippy::pedantic findings
Conservative cleanup pass — applied only the high-signal pedantic lints whose fixes either remove genuine waste or read more naturally, skipping anything stylistic that would bloat the diff. - map_unwrap_or: 29 .map(...).unwrap_or(...) sites collapsed to .map_or / .is_some_and / .map_or_else equivalents - uninlined_format_args: 7 production format!/write!/println! sites rewritten to the inline-argument style; assert! sites in test code intentionally untouched - match_same_arms: 2 redundant arms collapsed where the bodies were identical and the merger didn't obscure intent Public API is unchanged. No dependencies added or removed. The pedantic warning count dropped from 840 to 807 (-33). Out-of-scope findings — needless_pass_by_value on Bevy Res params, false-positive explicit_iter_loop on Bevy Query iterators, items_after_statements inside test mods, and the "ask before changing" merge logic in solitaire_sync — were intentionally deferred. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -153,8 +153,7 @@ fn toggle_leaderboard_screen(
|
||||
// Spawn the panel immediately with whatever data we have so far.
|
||||
let remote_available = provider
|
||||
.as_ref()
|
||||
.map(|p| p.0.backend_name() != "local")
|
||||
.unwrap_or(false);
|
||||
.is_some_and(|p| p.0.backend_name() != "local");
|
||||
spawn_leaderboard_screen(&mut commands, &data, remote_available, font_res.as_deref());
|
||||
|
||||
// Start a background fetch if not already in flight.
|
||||
@@ -215,8 +214,7 @@ fn update_leaderboard_panel(
|
||||
}
|
||||
let remote_available = provider
|
||||
.as_ref()
|
||||
.map(|p| p.0.backend_name() != "local")
|
||||
.unwrap_or(false);
|
||||
.is_some_and(|p| p.0.backend_name() != "local");
|
||||
for entity in &screens {
|
||||
commands.entity(entity).despawn();
|
||||
spawn_leaderboard_screen(&mut commands, &data, remote_available, font_res.as_deref());
|
||||
@@ -473,12 +471,10 @@ fn spawn_leaderboard_screen(
|
||||
|
||||
let time_str = entry
|
||||
.best_time_secs
|
||||
.map(format_secs)
|
||||
.unwrap_or_else(|| "-".to_string());
|
||||
.map_or_else(|| "-".to_string(), format_secs);
|
||||
let score_str = entry
|
||||
.best_score
|
||||
.map(|s| s.to_string())
|
||||
.unwrap_or_else(|| "-".to_string());
|
||||
.map_or_else(|| "-".to_string(), |s| s.to_string());
|
||||
|
||||
card.spawn(Node {
|
||||
flex_direction: FlexDirection::Row,
|
||||
|
||||
Reference in New Issue
Block a user