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.
This commit is contained in:
2026-07-12 19:07:45 +02:00
parent c348aa1c09
commit e1abba3fde

View File

@@ -494,15 +494,17 @@ impl CoreInner {
} }
async fn status(&self) -> RuntimeStatus { async fn status(&self) -> RuntimeStatus {
RuntimeStatus { let active_transfers = self
endpoint_id: self.endpoint.id().to_string(),
addr: format!("{:?}", self.endpoint.addr()),
active_transfers: self
.active_transfers .active_transfers
.lock() .lock()
.expect("active_transfers") .expect("active_transfers")
.len() as u64, .len() as u64;
active_shares: self.active_shares.lock().await.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,
active_shares,
} }
} }