fix(updater): restructure the release selection to satisfy clippy

The two branches that returned the candidate were identical, which
clippy flags as if_same_then_else. The condition is now a single
boolean.
This commit is contained in:
spearzificial 2026-10-21 17:45:10 +05:30
parent 34d49274d3
commit 8294bc8cea

View file

@ -64,15 +64,10 @@ fn pick_newer_release(current: Option<ReleaseInfo>, candidate: ReleaseInfo) -> R
match current {
None => candidate,
Some(current) => {
if is_newer(&candidate.version, &current.version) {
candidate
} else if candidate.version == current.version
&& candidate.assets.len() > current.assets.len()
{
candidate
} else {
current
}
let candidate_wins = is_newer(&candidate.version, &current.version)
|| (candidate.version == current.version
&& candidate.assets.len() > current.assets.len());
if candidate_wins { candidate } else { current }
}
}
}