From cfd1e670ddb803f4e67d4abd069fad271e1d1c7f Mon Sep 17 00:00:00 2001 From: konsti Date: Thu, 6 Feb 2025 10:49:44 +0100 Subject: [PATCH] Acquire reporter lock once (#11278) See https://github.com/astral-sh/uv/pull/11165#discussion_r1943853482 --- crates/uv/src/commands/reporters.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/uv/src/commands/reporters.rs b/crates/uv/src/commands/reporters.rs index b3a022e5b..289e1e09a 100644 --- a/crates/uv/src/commands/reporters.rs +++ b/crates/uv/src/commands/reporters.rs @@ -225,9 +225,9 @@ impl ProgressReporter { return; }; - let progress = state.lock().unwrap().bars.remove(&id).unwrap(); - - let size = state.lock().unwrap().download_size[&id]; + let mut state = state.lock().unwrap(); + let progress = state.bars.remove(&id).unwrap(); + let size = state.download_size[&id]; if multi_progress.is_hidden() && !*HAS_UV_TEST_NO_CLI_PROGRESS && size.is_none_or(|size| size > 1024 * 1024)