diff --git a/examples/routing.rs b/examples/routing.rs index 596e696..742a620 100644 --- a/examples/routing.rs +++ b/examples/routing.rs @@ -48,6 +48,7 @@ fn generate_doc(route_name: &str) -> Document { .add_link_without_label("/") .add_link_without_label("/route") .add_link_without_label("/route/long") - .add_link_without_label("/route/not_real"); + .add_link_without_label("/route/not_real") + .add_link_without_label("/rowte"); doc } diff --git a/src/routing.rs b/src/routing.rs index 225a58e..28966cb 100644 --- a/src/routing.rs +++ b/src/routing.rs @@ -93,7 +93,9 @@ impl RoutingNode { let mut node = self; for segment in path.segments() { - node = node.1.entry(segment.to_string()).or_default(); + if segment != "" { + node = node.1.entry(segment.to_string()).or_default(); + } } if node.0.is_some() {