From e1abba3fde9e02689bdabd5889ca6e548f7c5295 Mon Sep 17 00:00:00 2001 From: Hammed Abass Date: Sun, 12 Jul 2026 19:07:45 +0200 Subject: [PATCH] fix(core): drop active_transfers guard before await in status Clippy await_holding_lock failed because the sync MutexGuard lived across the active_shares.lock().await in the RuntimeStatus struct expr. --- crates/vnidrop/src/runtime.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/vnidrop/src/runtime.rs b/crates/vnidrop/src/runtime.rs index d24b131..4d1ce4e 100644 --- a/crates/vnidrop/src/runtime.rs +++ b/crates/vnidrop/src/runtime.rs @@ -494,15 +494,17 @@ impl CoreInner { } async fn status(&self) -> RuntimeStatus { + let active_transfers = self + .active_transfers + .lock() + .expect("active_transfers") + .len() as u64; + let active_shares = self.active_shares.lock().await.len() as u64; RuntimeStatus { endpoint_id: self.endpoint.id().to_string(), addr: format!("{:?}", self.endpoint.addr()), - active_transfers: self - .active_transfers - .lock() - .expect("active_transfers") - .len() as u64, - active_shares: self.active_shares.lock().await.len() as u64, + active_transfers, + active_shares, } }