diff --git a/src/types/json.rs b/src/types/json.rs index fbc47dd1c..d433f94f2 100644 --- a/src/types/json.rs +++ b/src/types/json.rs @@ -236,7 +236,7 @@ where #[derive(Clone)] pub struct JsonConfig { limit: usize, - ehandler: Option Error>>, + ehandler: Option Error + Send>>, } impl JsonConfig { @@ -249,7 +249,7 @@ impl JsonConfig { /// Set custom error handler pub fn error_handler(mut self, f: F) -> Self where - F: Fn(JsonPayloadError, &HttpRequest) -> Error + 'static, + F: Fn(JsonPayloadError, &HttpRequest) -> Error + Send + 'static, { self.ehandler = Some(Arc::new(f)); self