add Send trait requirement for Fn in JsonConfig error handler

This commit is contained in:
daddinuz 2019-05-08 22:01:51 +02:00
parent 9b93cc00ad
commit af29e9f7e8
1 changed files with 2 additions and 2 deletions

View File

@ -236,7 +236,7 @@ where
#[derive(Clone)]
pub struct JsonConfig {
limit: usize,
ehandler: Option<Arc<Fn(JsonPayloadError, &HttpRequest) -> Error>>,
ehandler: Option<Arc<dyn Fn(JsonPayloadError, &HttpRequest) -> Error + Send>>,
}
impl JsonConfig {
@ -249,7 +249,7 @@ impl JsonConfig {
/// Set custom error handler
pub fn error_handler<F>(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