Skip to content

Commit 50f48aa

Browse files
committed
Impl route key
1 parent cad83ac commit 50f48aa

27 files changed

Lines changed: 2274 additions & 1328 deletions

crates/vespera_core/src/route.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl TryFrom<&str> for HttpMethod {
4040
fn try_from(value: &str) -> Result<Self, Self::Error> {
4141
// Match case-insensitively without allocating an upper-cased copy
4242
// on the success path (HTTP method names are ASCII per RFC 9110);
43-
// the cold error path still reports the upper-cased value so the
43+
// the cold error path still reports the ASCII-uppercased value so the
4444
// message is byte-identical to the previous implementation.
4545
if value.eq_ignore_ascii_case("GET") {
4646
Ok(Self::Get)
@@ -59,7 +59,10 @@ impl TryFrom<&str> for HttpMethod {
5959
} else if value.eq_ignore_ascii_case("TRACE") {
6060
Ok(Self::Trace)
6161
} else {
62-
Err(format!("unknown HTTP method: {}", value.to_uppercase()))
62+
Err(format!(
63+
"unknown HTTP method: {}",
64+
value.to_ascii_uppercase()
65+
))
6366
}
6467
}
6568
}

0 commit comments

Comments
 (0)