mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-03 00:00:07 +02:00
Replace HasRoutes with Into<Router> (#819)
* Move `HasRoutes` into axum * fix doc test * Just use `Into<Router>`
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user