diff --git a/src/types.rs b/src/types.rs index b6250f2..b62a13b 100644 --- a/src/types.rs +++ b/src/types.rs @@ -472,7 +472,8 @@ pub struct Form { pub(crate) max_field_size: usize, pub(crate) max_files: u32, pub(crate) max_file_size: usize, - pub(crate) transform_error: Option actix_web::Error>>, + pub(crate) transform_error: + Option actix_web::Error + Send + Sync>>, inner: Map, } @@ -500,7 +501,7 @@ impl Form { /// Add an optional error handler to transform errors produced by the middleware pub fn transform_error( mut self, - f: impl Fn(crate::error::Error) -> actix_web::Error + 'static, + f: impl Fn(crate::error::Error) -> actix_web::Error + Send + Sync + 'static, ) -> Self { self.transform_error = Some(Arc::new(f));