Skip to content

Commit 4680561

Browse files
committed
fix(desktop): drop on_persist no-op clippy lint (closure is Copy)
clippy::dropping_copy_types rejected drop(on_persist) — the closure only borrows &sentinel_repo (a Copy type), so dropping it is a no-op. The borrow ends naturally with the last use inside run_scan_live above. Removed the line + added a WHY comment explaining why no explicit drop is needed.
1 parent 4bc301b commit 4680561

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/desktop/src/commands.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ pub async fn run_scan_inner_with_metadata(
414414
// in `flume::Receiver::recv` forever → `pthread_join` on writer
415415
// hangs the test. Reproduced 2026-04-23 with gdb backtrace
416416
// (Thread 18 → futex on writer's TID; Thread 17 → flume recv).
417-
drop(on_persist); // releases &sentinel_repo borrow
417+
// The `on_persist` closure is `Copy` (only borrows `&sentinel_repo`)
418+
// so it doesn't need explicit `drop`; its borrow on `sentinel_repo`
419+
// ends with the last use inside `run_scan_live` above.
418420
drop(file_repo);
419421
drop(vol_repo);
420422
drop(sentinel_repo);

0 commit comments

Comments
 (0)