diff --git a/crates/core/src/commands/check.rs b/crates/core/src/commands/check.rs index f66207c3..c71649b3 100644 --- a/crates/core/src/commands/check.rs +++ b/crates/core/src/commands/check.rs @@ -361,16 +361,7 @@ pub(crate) fn check_repository( p.finish(); } - let mut summary = Arc::try_unwrap(summary) - .map_err(|_err| RusticError::new(ErrorKind::Internal, "Error unwrapping Mutex from Arc."))? - .into_inner() - .map_err(|err| { - RusticError::with_source( - ErrorKind::Internal, - "Mutex poisoned while getting summary for check command.", - err, - ) - })?; + let mut summary = Summary::retrieve_from_arc_mutex(summary)?; summary.complete(); @@ -507,16 +498,7 @@ fn check_cache_files( p.finish(); - let mut summary = Arc::try_unwrap(summary) - .map_err(|_err| RusticError::new(ErrorKind::Internal, "Error unwrapping Mutex from Arc."))? - .into_inner() - .map_err(|err| { - RusticError::with_source( - ErrorKind::Internal, - "Mutex poisoned while getting summary for check command.", - err, - ) - })?; + let mut summary = Summary::retrieve_from_arc_mutex(summary)?; summary.complete();