From 7eea99becd0bbcdd418fc0b2146c90f1f37e3d06 Mon Sep 17 00:00:00 2001 From: daddinuz Date: Wed, 8 May 2019 22:04:37 +0200 Subject: [PATCH] add Sync 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 d433f94f2..62ec5b6bd 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 + Send>>, + ehandler: Option Error + Send + Sync>>, } 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 + Send + 'static, + F: Fn(JsonPayloadError, &HttpRequest) -> Error + Send + Sync + 'static, { self.ehandler = Some(Arc::new(f)); self