Skip to content

Commit

Permalink
remove rarely used is_token method from ByteString
Browse files Browse the repository at this point in the history
  • Loading branch information
TimNN committed Feb 23, 2016
1 parent 90c7b78 commit 3af3926
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions components/script/dom/bindings/str.rs
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions components/script/dom/xmlhttprequest.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3af3926

Please sign in to comment.