diff --git a/axum-debug/src/lib.rs b/axum-debug/src/lib.rs index d0fdba77..ab377539 100644 --- a/axum-debug/src/lib.rs +++ b/axum-debug/src/lib.rs @@ -346,7 +346,7 @@ mod debug { fn debug_handler(_f: F) where - F: ::std::ops::FnOnce(#(#generics),*) -> Fut + Clone + Send + Sync + 'static, + F: ::std::ops::FnOnce(#(#generics),*) -> Fut + Clone + Send + 'static, Fut: ::std::future::Future + Send, {} } diff --git a/axum/src/handler/mod.rs b/axum/src/handler/mod.rs index d41cdab9..f0799f07 100644 --- a/axum/src/handler/mod.rs +++ b/axum/src/handler/mod.rs @@ -41,7 +41,7 @@ //! - Are `async fn`s. //! - Take no more than 16 arguments that all implement [`FromRequest`]. //! - Returns something that implements [`IntoResponse`]. -//! - If a closure is used it must implement `Clone + Send + Sync` and be +//! - If a closure is used it must implement `Clone + Send` and be //! `'static`. //! - Returns a future that is `Send`. The most common way to accidentally make a //! future `!Send` is to hold a `!Send` type across an await. @@ -264,7 +264,7 @@ pub trait Handler: Clone + Send + Sized + 'static { #[async_trait] impl Handler for F where - F: FnOnce() -> Fut + Clone + Send + Sync + 'static, + F: FnOnce() -> Fut + Clone + Send + 'static, Fut: Future + Send, Res: IntoResponse, B: Send + 'static, @@ -282,7 +282,7 @@ macro_rules! impl_handler { #[allow(non_snake_case)] impl Handler for F where - F: FnOnce($($ty,)*) -> Fut + Clone + Send + Sync + 'static, + F: FnOnce($($ty,)*) -> Fut + Clone + Send + 'static, Fut: Future + Send, B: Send + 'static, Res: IntoResponse,