mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
Derive Debug for Router instead of implementing manually (#463)
This commit is contained in:
+1
-10
@@ -62,6 +62,7 @@ impl RouteId {
|
||||
}
|
||||
|
||||
/// The router type for composing handlers and services.
|
||||
#[derive(Debug)]
|
||||
pub struct Router<B = Body> {
|
||||
routes: HashMap<RouteId, Route<B>>,
|
||||
node: Node,
|
||||
@@ -87,16 +88,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<B> fmt::Debug for Router<B> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Router")
|
||||
.field("routes", &self.routes)
|
||||
.field("node", &self.node)
|
||||
.field("fallback", &self.fallback)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) const NEST_TAIL_PARAM: &str = "axum_nest";
|
||||
const NEST_TAIL_PARAM_CAPTURE: &str = "/*axum_nest";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user