mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
remove rarely used is_token
method from ByteString
This commit is contained in:
parent
90c7b78b12
commit
3af3926d63
2 changed files with 3 additions and 9 deletions
|
@ -49,12 +49,6 @@ impl ByteString {
|
|||
ByteString::new(self.0.to_ascii_lowercase())
|
||||
}
|
||||
|
||||
/// Returns whether `self` is a `token`, as defined by
|
||||
/// [RFC 2616](http://tools.ietf.org/html/rfc2616#page-17).
|
||||
pub fn is_token(&self) -> bool {
|
||||
is_token(&self.0)
|
||||
}
|
||||
|
||||
/// Returns whether `self` is a `field-value`, as defined by
|
||||
/// [RFC 2616](http://tools.ietf.org/html/rfc2616#page-32).
|
||||
pub fn is_field_value(&self) -> bool {
|
||||
|
|
|
@ -21,7 +21,7 @@ use dom::bindings::js::{JS, MutHeapJSVal, MutNullableHeap};
|
|||
use dom::bindings::js::{Root, RootedReference};
|
||||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::bindings::reflector::{Reflectable, reflect_dom_object};
|
||||
use dom::bindings::str::{ByteString, USVString};
|
||||
use dom::bindings::str::{ByteString, USVString, is_token};
|
||||
use dom::blob::Blob;
|
||||
use dom::document::DocumentSource;
|
||||
use dom::document::{Document, IsHTMLDocument};
|
||||
|
@ -345,7 +345,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
Some(Method::Extension(ref t)) if &**t == "TRACK" => Err(Error::Security),
|
||||
Some(parsed_method) => {
|
||||
// Step 3
|
||||
if !method.is_token() {
|
||||
if !is_token(&method) {
|
||||
return Err(Error::Syntax)
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
}
|
||||
// FIXME(#9548): Step 3. Normalize value
|
||||
// Step 4
|
||||
if !name.is_token() || !value.is_field_value() {
|
||||
if !is_token(&name) || !value.is_field_value() {
|
||||
return Err(Error::Syntax);
|
||||
}
|
||||
let name_lower = name.to_lower();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue