diff --git a/crates/anemo/src/routing/mod.rs b/crates/anemo/src/routing/mod.rs index b87a451e..137f6058 100644 --- a/crates/anemo/src/routing/mod.rs +++ b/crates/anemo/src/routing/mod.rs @@ -1,6 +1,11 @@ use crate::{Request, Response}; use bytes::Bytes; -use std::{collections::HashMap, convert::Infallible, fmt, sync::Arc}; +use std::{ + collections::{BTreeMap, HashMap}, + convert::Infallible, + fmt, + sync::Arc, +}; use tower::{ util::{BoxCloneService, Oneshot}, Service, @@ -30,7 +35,7 @@ impl RouteId { /// The router type for composing handlers and services. #[derive(Clone)] pub struct Router { - routes: HashMap, + routes: BTreeMap, matcher: RouteMatcher, fallback: Route, }