add Sync trait requirement for Fn in JsonConfig error handler

This commit is contained in:
daddinuz 2019-05-08 22:04:37 +02:00
parent af29e9f7e8
commit 7eea99becd
1 changed files with 2 additions and 2 deletions

View File

@ -236,7 +236,7 @@ where
#[derive(Clone)] #[derive(Clone)]
pub struct JsonConfig { pub struct JsonConfig {
limit: usize, limit: usize,
ehandler: Option<Arc<dyn Fn(JsonPayloadError, &HttpRequest) -> Error + Send>>, ehandler: Option<Arc<dyn Fn(JsonPayloadError, &HttpRequest) -> Error + Send + Sync>>,
} }
impl JsonConfig { impl JsonConfig {
@ -249,7 +249,7 @@ impl JsonConfig {
/// Set custom error handler /// Set custom error handler
pub fn error_handler<F>(mut self, f: F) -> Self pub fn error_handler<F>(mut self, f: F) -> Self
where where
F: Fn(JsonPayloadError, &HttpRequest) -> Error + Send + 'static, F: Fn(JsonPayloadError, &HttpRequest) -> Error + Send + Sync + 'static,
{ {
self.ehandler = Some(Arc::new(f)); self.ehandler = Some(Arc::new(f));
self self