diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index aa5ada01..1a7f7de2 100644 --- a/axum/src/routing/mod.rs +++ b/axum/src/routing/mod.rs @@ -481,6 +481,10 @@ where } /// Convert this router into a [`RouterService`]. + /// + /// # Panics + /// + /// Panics if the router was constructed with [`Router::inherit_state`]. #[track_caller] pub fn into_service(self) -> RouterService { RouterService::new(self) diff --git a/axum/src/routing/service.rs b/axum/src/routing/service.rs index c8a708b3..bcf9ee3b 100644 --- a/axum/src/routing/service.rs +++ b/axum/src/routing/service.rs @@ -18,7 +18,7 @@ use crate::{ response::Response, }; -/// TOOD: Docs +/// A [`Router`] converted into a [`Service`]. #[derive(Debug)] pub struct RouterService { routes: HashMap>, @@ -129,7 +129,6 @@ impl Clone for RouterService { impl Service> for RouterService where B: HttpBody + Send + 'static, - //S: Send + Sync + 'static, { type Response = Response; type Error = Infallible;