Add Send + Sync bounds

This commit is contained in:
asonix 2020-06-13 13:56:11 -05:00
parent 41efb3153d
commit 070c4a4d4a

View file

@ -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<Arc<dyn Fn(crate::error::Error) -> actix_web::Error>>,
pub(crate) transform_error:
Option<Arc<dyn Fn(crate::error::Error) -> 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));