Skip to content

Commit

Permalink
feat: streamline summary retrieval by replacing Mutex unwrapping with…
Browse files Browse the repository at this point in the history
… retrieve_from_arc_mutex

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
  • Loading branch information
simonsan committed Nov 25, 2024
1 parent 6bd5041 commit cc36d48
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions crates/core/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,7 @@ pub(crate) fn check_repository<P: ProgressBars, S: Open>(
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)?;

Check failure on line 364 in crates/core/src/commands/check.rs

View workflow job for this annotation

GitHub Actions / Cross checking x86_64-unknown-linux-gnu

no function or associated item named `retrieve_from_arc_mutex` found for struct `Summary` in the current scope

summary.complete();

Expand Down Expand Up @@ -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)?;

Check failure on line 501 in crates/core/src/commands/check.rs

View workflow job for this annotation

GitHub Actions / Cross checking x86_64-unknown-linux-gnu

no function or associated item named `retrieve_from_arc_mutex` found for struct `Summary` in the current scope

summary.complete();

Expand Down

0 comments on commit cc36d48

Please sign in to comment.