Replace HasRoutes with Into<Router> (#819)

* Move `HasRoutes` into axum

* fix doc test

* Just use `Into<Router>`
This commit is contained in:
David Pedersen
2022-03-03 21:50:31 +00:00
committed by GitHub
parent 99fbd3d32c
commit d943ba6d81
5 changed files with 17 additions and 56 deletions
+5 -2
View File
@@ -245,13 +245,16 @@ where
}
#[doc = include_str!("../docs/routing/merge.md")]
pub fn merge(mut self, other: Router<B>) -> Self {
pub fn merge<R>(mut self, other: R) -> Self
where
R: Into<Router<B>>,
{
let Router {
routes,
node,
fallback,
nested_at_root,
} = other;
} = other.into();
for (id, route) in routes {
let path = node