Skip to content

Commit

Permalink
fix(rustup): 1.0.0-nightly (e2fa53e59 2015-03-20)
Browse files Browse the repository at this point in the history
* replace `char_at()` calls with itertor, as suggested by compiler
* fixed comparison in test
  • Loading branch information
Byron committed Mar 21, 2015
1 parent 5d7be77 commit f547080
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/header/common/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ impl Header for Host {
// https://github.com/servo/rust-url/issues/42
let idx = {
let slice = &s[..];
if slice.char_at(1) == '[' {
let mut chars = slice.chars();
chars.next();
if chars.next().unwrap() == '[' {
match slice.rfind(']') {
Some(idx) => {
if slice.len() > idx + 2 {
Expand Down
2 changes: 1 addition & 1 deletion src/header/shared/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl FromStr for EntityTag {
}

// 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,
// we already did that above.
if check_slice_validity(slice.slice_chars(1, length-1)) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,6 @@ mod tests {
");

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"[..]);
}
}

0 comments on commit f547080

Please sign in to comment.