changed match to 'matches!' (#31850)

This commit is contained in:
Aarya Khandelwal 2024-03-25 16:58:12 +05:30 committed by GitHub
parent 9a76dd9325
commit bd39e03eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 185 additions and 229 deletions

View file

@ -344,10 +344,7 @@ impl Iterable for Headers {
// https://fetch.spec.whatwg.org/#forbidden-response-header-name
fn is_forbidden_response_header(name: &str) -> bool {
match name {
"set-cookie" | "set-cookie2" => true,
_ => false,
}
matches!(name, "set-cookie" | "set-cookie2")
}
// https://fetch.spec.whatwg.org/#forbidden-header-name
@ -487,18 +484,12 @@ fn is_legal_header_value(value: &ByteString) -> bool {
// https://tools.ietf.org/html/rfc5234#appendix-B.1
pub fn is_vchar(x: u8) -> bool {
match x {
0x21..=0x7E => true,
_ => false,
}
matches!(x, 0x21..=0x7E)
}
// http://tools.ietf.org/html/rfc7230#section-3.2.6
pub fn is_obs_text(x: u8) -> bool {
match x {
0x80..=0xFF => true,
_ => false,
}
matches!(x, 0x80..=0xFF)
}
// https://fetch.spec.whatwg.org/#concept-header-extract-mime-type