From a47d7eca40189d6c3faf8c00b5405770bccac346 Mon Sep 17 00:00:00 2001 From: david-perez Date: Thu, 4 Nov 2021 12:35:50 +0100 Subject: [PATCH] Derive `Debug` for `Router` instead of implementing manually (#463) --- axum/src/routing/mod.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index 86ebff78..538b2939 100644 --- a/axum/src/routing/mod.rs +++ b/axum/src/routing/mod.rs @@ -62,6 +62,7 @@ impl RouteId { } /// The router type for composing handlers and services. +#[derive(Debug)] pub struct Router { routes: HashMap>, node: Node, @@ -87,16 +88,6 @@ where } } -impl fmt::Debug for Router { - 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";