From d5ff7fb8089a8c393312327ab801fcf97641bc3f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 15 May 2022 12:04:23 +0100 Subject: [PATCH] Make InternalLogicError be Clone, with an Arc shapelib wants this for SubstErrors which ought to be Clone. Signed-off-by: Ian Jackson --- src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/error.rs b/src/error.rs index 3b9554ea..c234a991 100644 --- a/src/error.rs +++ b/src/error.rs @@ -64,10 +64,10 @@ pub enum InternalError { #[error("Unsupported colour spec")] pub struct UnsupportedColourSpec; -#[derive(Error)] +#[derive(Error,Clone)] pub struct InternalLogicError { desc: Cow<'static, str>, - backtrace: parking_lot::Mutex, + backtrace: Arc>, } pub fn internal_error_bydebug(desc: &dyn Debug) -> IE { @@ -79,7 +79,7 @@ impl InternalLogicError { let backtrace = backtrace::Backtrace::new_unresolved(); InternalLogicError { desc: desc.into(), - backtrace: parking_lot::Mutex::new(backtrace), + backtrace: Arc::new(parking_lot::Mutex::new(backtrace)), } } } -- 2.30.2