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:
parent
34d49274d3
commit
8294bc8cea
1 changed files with 4 additions and 9 deletions
|
|
@ -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, ¤t.version) {
|
||||
candidate
|
||||
} else if candidate.version == current.version
|
||||
&& candidate.assets.len() > current.assets.len()
|
||||
{
|
||||
candidate
|
||||
} else {
|
||||
current
|
||||
}
|
||||
let candidate_wins = is_newer(&candidate.version, ¤t.version)
|
||||
|| (candidate.version == current.version
|
||||
&& candidate.assets.len() > current.assets.len());
|
||||
if candidate_wins { candidate } else { current }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue