diff --git a/axum/src/handler/mod.rs b/axum/src/handler/mod.rs index f30fb775..fc58831c 100644 --- a/axum/src/handler/mod.rs +++ b/axum/src/handler/mod.rs @@ -92,14 +92,6 @@ mod into_service; pub use self::into_service::IntoService; -pub(crate) mod sealed { - #![allow(unreachable_pub, missing_docs, missing_debug_implementations)] - - pub trait HiddenTrait {} - pub struct Hidden; - impl HiddenTrait for Hidden {} -} - /// Trait for async functions that can be used to handle requests. /// /// You shouldn't need to depend on this trait directly. It is automatically @@ -108,11 +100,6 @@ pub(crate) mod sealed { /// See the [module docs](crate::handler) for more details. #[async_trait] pub trait Handler: Clone + Send + Sized + 'static { - // This seals the trait. We cannot use the regular "sealed super trait" - // approach due to coherence. - #[doc(hidden)] - type Sealed: sealed::HiddenTrait; - /// Call the handler with the given request. async fn call(self, req: Request) -> Response; @@ -268,8 +255,6 @@ where Res: IntoResponse, B: Send + 'static, { - type Sealed = sealed::Hidden; - async fn call(self, _req: Request) -> Response { self().await.into_response() } @@ -287,8 +272,6 @@ macro_rules! impl_handler { Res: IntoResponse, $( $ty: FromRequest + Send,)* { - type Sealed = sealed::Hidden; - async fn call(self, req: Request) -> Response { let mut req = RequestParts::new(req); @@ -346,8 +329,6 @@ where ResBody: HttpBody + Send + 'static, ResBody::Error: Into, { - type Sealed = sealed::Hidden; - async fn call(self, req: Request) -> Response { match self.svc.oneshot(req).await { Ok(res) => res.map(boxed),