diff options
Diffstat (limited to 'components/net/cookie.rs')
-rw-r--r-- | components/net/cookie.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/net/cookie.rs b/components/net/cookie.rs index eb3c1a61a97..dfca6912c94 100644 --- a/components/net/cookie.rs +++ b/components/net/cookie.rs @@ -13,13 +13,13 @@ use time::{Tm, now, at, Timespec}; use url::Url; use std::borrow::ToOwned; use std::i64; -use std::io::net::ip::IpAddr; +use std::old_io::net::ip::IpAddr; use std::time::Duration; /// A stored cookie that wraps the definition in cookie-rs. This is used to implement /// various behaviours defined in the spec that rely on an associated request URL, /// which cookie-rs and hyper's header parsing do not support. -#[derive(Clone, Show)] +#[derive(Clone, Debug)] pub struct Cookie { pub cookie: cookie_rs::Cookie, pub host_only: bool, @@ -100,7 +100,7 @@ impl Cookie { request_path.chars().filter(|&c| c == '/').count() == 1 { "/".to_owned() } else if request_path.ends_with("/") { - request_path.slice_to(request_path.len()-1).to_owned() + request_path[..request_path.len() - 1].to_owned() } else { request_path.to_owned() } @@ -121,7 +121,7 @@ impl Cookie { } if string.ends_with(domain_string) && string.char_at(string.len()-domain_string.len()-1) == '.' - && string.parse::<IpAddr>().is_none() { + && string.parse::<IpAddr>().is_err() { return true; } false |