Skip to content

Commit cc36d48

Browse files
committed
feat: streamline summary retrieval by replacing Mutex unwrapping with retrieve_from_arc_mutex
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
1 parent 6bd5041 commit cc36d48

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

crates/core/src/commands/check.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,7 @@ pub(crate) fn check_repository<P: ProgressBars, S: Open>(
361361
p.finish();
362362
}
363363

364-
let mut summary = Arc::try_unwrap(summary)
365-
.map_err(|_err| RusticError::new(ErrorKind::Internal, "Error unwrapping Mutex from Arc."))?
366-
.into_inner()
367-
.map_err(|err| {
368-
RusticError::with_source(
369-
ErrorKind::Internal,
370-
"Mutex poisoned while getting summary for check command.",
371-
err,
372-
)
373-
})?;
364+
let mut summary = Summary::retrieve_from_arc_mutex(summary)?;
374365

375366
summary.complete();
376367

@@ -507,16 +498,7 @@ fn check_cache_files(
507498

508499
p.finish();
509500

510-
let mut summary = Arc::try_unwrap(summary)
511-
.map_err(|_err| RusticError::new(ErrorKind::Internal, "Error unwrapping Mutex from Arc."))?
512-
.into_inner()
513-
.map_err(|err| {
514-
RusticError::with_source(
515-
ErrorKind::Internal,
516-
"Mutex poisoned while getting summary for check command.",
517-
err,
518-
)
519-
})?;
501+
let mut summary = Summary::retrieve_from_arc_mutex(summary)?;
520502

521503
summary.complete();
522504

0 commit comments

Comments
 (0)