mirror of https://github.com/fafhrd91/actix-web
add Send trait requirement for Fn in JsonConfig error handler
This commit is contained in:
parent
9b93cc00ad
commit
af29e9f7e8
|
@ -236,7 +236,7 @@ where
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct JsonConfig {
|
pub struct JsonConfig {
|
||||||
limit: usize,
|
limit: usize,
|
||||||
ehandler: Option<Arc<Fn(JsonPayloadError, &HttpRequest) -> Error>>,
|
ehandler: Option<Arc<dyn Fn(JsonPayloadError, &HttpRequest) -> Error + Send>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
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 + 'static,
|
F: Fn(JsonPayloadError, &HttpRequest) -> Error + Send + 'static,
|
||||||
{
|
{
|
||||||
self.ehandler = Some(Arc::new(f));
|
self.ehandler = Some(Arc::new(f));
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in New Issue