You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the `Router` stores HTTP methods for an endpoint as
`String`s. This is a bit unfortunate, as it means the already-parsed
`http::Method` for each request has to be un-parsed back into a `String`
to look it up in the map, allocating a new `String` each time and
converting it to uppercases to perform the lookup. Switching to the
typed `http::Method` representation should make things a bit more
efficient (especially as `Method` also implements inline storage for
extension methods up to a certain length) and provide additional type
safety. This does require switching from a `BTreeMap` of strings to
handlers to a `HashMap` of `Method`s to handlers, as `Method` does not
implement `Ord`/`PartialOrd`, but ordering shouldn't matter here.
0 commit comments