Skip to content

Commit 97f02ae

Browse files
committed
fix: add Send, Sync on Exception
1 parent 4d27d18 commit 97f02ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/error.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::fmt::Display;
1+
use std::fmt;
22

33
use crate::protocol::{
44
outbound_message::compile_response::CompileFailure, ProtocolError, SourceSpan,
@@ -17,7 +17,7 @@ pub struct Exception {
1717
sass_message: Option<String>,
1818
sass_stack: Option<String>,
1919
span: Option<SourceSpan>,
20-
source: Option<Box<dyn std::error::Error + 'static>>,
20+
source: Option<Box<dyn std::error::Error + Send + Sync + 'static>>,
2121
}
2222

2323
impl Exception {
@@ -48,10 +48,10 @@ impl Exception {
4848

4949
impl std::error::Error for Exception {}
5050

51-
impl Display for Exception {
51+
impl fmt::Display for Exception {
5252
/// More information:
5353
/// - [Sass documentation](https://sass-lang.com/documentation/js-api/classes/Exception#toString)
54-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
54+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5555
write!(f, "{}", self.message)
5656
}
5757
}
@@ -89,7 +89,7 @@ impl Exception {
8989
/// Sets the source error of the exception.
9090
pub fn set_source(
9191
mut self,
92-
source: impl std::error::Error + 'static,
92+
source: impl std::error::Error + Send + Sync + 'static,
9393
) -> Self {
9494
self.source = Some(Box::new(source));
9595
self

0 commit comments

Comments
 (0)