Merge pull request #384 from Byron/master

fix(rustup): 1.0.0-nightly (e2fa53e59 2015-03-20)
This commit is contained in:
Sean McArthur
2015-03-21 11:35:02 -07:00
3 changed files with 5 additions and 3 deletions

View File

@@ -28,7 +28,9 @@ impl Header for Host {
// https://github.com/servo/rust-url/issues/42 // https://github.com/servo/rust-url/issues/42
let idx = { let idx = {
let slice = &s[..]; let slice = &s[..];
if slice.char_at(1) == '[' { let mut chars = slice.chars();
chars.next();
if chars.next().unwrap() == '[' {
match slice.rfind(']') { match slice.rfind(']') {
Some(idx) => { Some(idx) => {
if slice.len() > idx + 2 { if slice.len() > idx + 2 {

View File

@@ -52,7 +52,7 @@ impl FromStr for EntityTag {
} }
// The etag is weak if its first char is not a DQUOTE. // The etag is weak if its first char is not a DQUOTE.
if slice.char_at(0) == '"' /* '"' */ { if slice.chars().next().unwrap() == '"' /* '"' */ {
// No need to check if the last char is a DQUOTE, // No need to check if the last char is a DQUOTE,
// we already did that above. // we already did that above.
if check_slice_validity(slice.slice_chars(1, length-1)) { if check_slice_validity(slice.slice_chars(1, length-1)) {

View File

@@ -264,6 +264,6 @@ mod tests {
"); ");
handle_connection(&mut mock, &Reject); handle_connection(&mut mock, &Reject);
assert_eq!(mock.write, b"HTTP/1.1 417 Expectation Failed\r\n\r\n"); assert_eq!(mock.write, &b"HTTP/1.1 417 Expectation Failed\r\n\r\n"[..]);
} }
} }