diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-01-27 18:15:50 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-01-27 18:15:50 -0700 |
commit | 3f9012864a2cd927cf17a8e11dfa6922add1b7df (patch) | |
tree | 2bb312c53b839df71b5f8115e91f90ea57d0620a /components/script/dom/bindings/str.rs | |
parent | ff8cbff81016c157373c1675f3eee69dd70ae544 (diff) | |
parent | 7fec73a432bcc2148b8866051ecb11be8d311fe3 (diff) | |
download | servo-3f9012864a2cd927cf17a8e11dfa6922add1b7df.tar.gz servo-3f9012864a2cd927cf17a8e11dfa6922add1b7df.zip |
auto merge of #4719 : servo/servo/rustup_20150109, r=jdm
Diffstat (limited to 'components/script/dom/bindings/str.rs')
-rw-r--r-- | components/script/dom/bindings/str.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs index e67c8ac7d6a..77653513717 100644 --- a/components/script/dom/bindings/str.rs +++ b/components/script/dom/bindings/str.rs @@ -7,12 +7,12 @@ //! The `ByteString` struct. use std::borrow::ToOwned; -use std::hash::{Hash, sip}; +use std::hash::{Hash, SipHasher}; use std::str; use std::str::FromStr; /// Encapsulates the IDL `ByteString` type. -#[deriving(Clone,Eq,PartialEq)] +#[derive(Clone,Eq,PartialEq)] #[jstraceable] pub struct ByteString(Vec<u8>); @@ -26,7 +26,7 @@ impl ByteString { /// otherwise. pub fn as_str<'a>(&'a self) -> Option<&'a str> { let ByteString(ref vec) = *self; - str::from_utf8(vec.as_slice()) + str::from_utf8(vec.as_slice()).ok() } /// Returns the underlying vector as a slice. @@ -84,7 +84,7 @@ impl ByteString { /// [RFC 2616](http://tools.ietf.org/html/rfc2616#page-32). pub fn is_field_value(&self) -> bool { // Classifications of characters necessary for the [CRLF] (SP|HT) rule - #[deriving(PartialEq)] + #[derive(PartialEq)] enum PreviousCharacter { Other, CR, @@ -146,8 +146,8 @@ impl ByteString { } } -impl Hash for ByteString { - fn hash(&self, state: &mut sip::SipState) { +impl Hash<SipHasher> for ByteString { + fn hash(&self, state: &mut SipHasher) { let ByteString(ref vec) = *self; vec.hash(state); } |