refactor(sync): destructure remote in deleted-local branch

The `(None, Some(_), Some(b))` arm re-checked the already-matched
`remote` via `remote.is_some_and(...)`, which obscures intent and
compiles to redundant None-branch code. Bind `Some(r)` in the match
and use `r` directly.

No behavior change.
This commit is contained in:
Claude 2026-04-24 07:36:28 +00:00
parent 1bb1b67977
commit 970210b647
No known key found for this signature in database

View file

@ -204,8 +204,9 @@ pub fn compute_sync_actions(
} }
// Remote present, local gone, base known: local was deleted // Remote present, local gone, base known: local was deleted
(None, Some(_), Some(b)) => { (None, Some(r), Some(b)) => {
let remote_changed = remote.is_some_and(|r| r.size != b.size || !timestamps_equal(r.last_modified.as_deref(), b.modified_at.as_deref())); let remote_changed = r.size != b.size
|| !timestamps_equal(r.last_modified.as_deref(), b.modified_at.as_deref());
if remote_changed { if remote_changed {
// deleted locally + modified remotely -> download (remote wins) // deleted locally + modified remotely -> download (remote wins)
actions.push(SyncAction::Download { path: path.to_string() }); actions.push(SyncAction::Download { path: path.to_string() });