From af29e9f7e8ccfa4b4d9fa99726f858bdf95bb51f Mon Sep 17 00:00:00 2001 From: daddinuz Date: Wed, 8 May 2019 22:01:51 +0200 Subject: [PATCH] add Send trait requirement for Fn in JsonConfig error handler --- src/types/json.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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