mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Empty methods are not allowed
This commit is contained in:
parent
30827bab4d
commit
86594a752c
2 changed files with 7 additions and 1 deletions
|
@ -47,6 +47,9 @@ impl ByteString {
|
|||
|
||||
pub fn is_token(&self) -> bool {
|
||||
let ByteString(ref vec) = *self;
|
||||
if vec.len() == 0 {
|
||||
return false; // A token must be at least a single character
|
||||
}
|
||||
vec.iter().all(|&x| {
|
||||
// http://tools.ietf.org/html/rfc2616#section-2.2
|
||||
match x {
|
||||
|
@ -55,6 +58,7 @@ impl ByteString {
|
|||
44 | 59 | 58 | 92 | 34 |
|
||||
47 | 91 | 93 | 63 | 61 |
|
||||
123 | 125 | 32 => false, // separators
|
||||
x if x > 127 => false, // non-CHARs
|
||||
_ => true
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue