mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
changed match
to 'matches!' (#31850)
This commit is contained in:
parent
9a76dd9325
commit
bd39e03eeb
29 changed files with 185 additions and 229 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue