Skip to content

Commit

Permalink
feat: add methods to convert Summary into boxed and arc mutex types
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Nov 25, 2024
1 parent 6d61317 commit a27dc6e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/core/src/error/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use std::{
collections::{BTreeMap, HashSet},
fmt::{self, Display, Write},
sync::{Arc, Mutex},
time::Instant,
};

Expand Down Expand Up @@ -292,6 +293,14 @@ impl Summary {
self.issues.extend(other.issues);
self.metrics.extend(other.metrics);
}

pub fn into_boxed(self) -> Box<Self> {
Box::new(self)
}

pub fn into_arc_mutex(self) -> Arc<Mutex<Self>> {
Arc::new(Mutex::new(self))
}
}

// Display Helpers
Expand Down

0 comments on commit a27dc6e

Please sign in to comment.