mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-29 15:49:16 +01:00
Don't create a RouteId
if routes can be merged (#2174)
This commit is contained in:
parent
f7988398d0
commit
483ba7d5b5
1 changed files with 1 additions and 2 deletions
|
@ -53,8 +53,6 @@ where
|
||||||
|
|
||||||
validate_path(path)?;
|
validate_path(path)?;
|
||||||
|
|
||||||
let id = self.next_route_id();
|
|
||||||
|
|
||||||
let endpoint = if let Some((route_id, Endpoint::MethodRouter(prev_method_router))) = self
|
let endpoint = if let Some((route_id, Endpoint::MethodRouter(prev_method_router))) = self
|
||||||
.node
|
.node
|
||||||
.path_to_route_id
|
.path_to_route_id
|
||||||
|
@ -74,6 +72,7 @@ where
|
||||||
Endpoint::MethodRouter(method_router)
|
Endpoint::MethodRouter(method_router)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let id = self.next_route_id();
|
||||||
self.set_node(path, id)?;
|
self.set_node(path, id)?;
|
||||||
self.routes.insert(id, endpoint);
|
self.routes.insert(id, endpoint);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue