aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/str.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-12-17 10:42:52 +0100
committerJosh Matthews <josh@joshmatthews.net>2014-12-17 15:19:45 -0500
commit466faac2a507c833b282e274a28f6ae533c628f9 (patch)
tree0022a66d52deec0081b8b721b56e2f15d7225f8e /components/script/dom/bindings/str.rs
parentb8900782b0fcb409f37189bdc08eb7f8b3564a5f (diff)
downloadservo-466faac2a507c833b282e274a28f6ae533c628f9.tar.gz
servo-466faac2a507c833b282e274a28f6ae533c628f9.zip
Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.
Diffstat (limited to 'components/script/dom/bindings/str.rs')
-rw-r--r--components/script/dom/bindings/str.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index a06aaed5ec4..0882b3538e2 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -4,9 +4,9 @@
//! The `ByteString` struct.
-use std::from_str::FromStr;
use std::hash::{Hash, sip};
use std::str;
+use std::str::FromStr;
/// Encapsulates the IDL `ByteString` type.
#[deriving(Clone,Eq,PartialEq)]
@@ -89,31 +89,31 @@ impl ByteString {
SPHT // SP or HT
}
let ByteString(ref vec) = *self;
- let mut prev = Other; // The previous character
+ let mut prev = PreviousCharacter::Other; // The previous character
vec.iter().all(|&x| {
// http://tools.ietf.org/html/rfc2616#section-2.2
match x {
13 => { // CR
- if prev == Other || prev == SPHT {
- prev = CR;
+ if prev == PreviousCharacter::Other || prev == PreviousCharacter::SPHT {
+ prev = PreviousCharacter::CR;
true
} else {
false
}
},
10 => { // LF
- if prev == CR {
- prev = LF;
+ if prev == PreviousCharacter::CR {
+ prev = PreviousCharacter::LF;
true
} else {
false
}
},
32 => { // SP
- if prev == LF || prev == SPHT {
- prev = SPHT;
+ if prev == PreviousCharacter::LF || prev == PreviousCharacter::SPHT {
+ prev = PreviousCharacter::SPHT;
true
- } else if prev == Other {
+ } else if prev == PreviousCharacter::Other {
// Counts as an Other here, since it's not preceded by a CRLF
// SP is not a CTL, so it can be used anywhere
// though if used immediately after a CR the CR is invalid
@@ -124,8 +124,8 @@ impl ByteString {
}
},
9 => { // HT
- if prev == LF || prev == SPHT {
- prev = SPHT;
+ if prev == PreviousCharacter::LF || prev == PreviousCharacter::SPHT {
+ prev = PreviousCharacter::SPHT;
true
} else {
false
@@ -133,8 +133,8 @@ impl ByteString {
},
0...31 | 127 => false, // CTLs
x if x > 127 => false, // non ASCII
- _ if prev == Other || prev == SPHT => {
- prev = Other;
+ _ if prev == PreviousCharacter::Other || prev == PreviousCharacter::SPHT => {
+ prev = PreviousCharacter::Other;
true
},
_ => false // Previous character was a CR/LF but not part of the [CRLF] (SP|HT) rule