aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/cookie.rs
diff options
context:
space:
mode:
authorAvi Weinstock <aweinstock314@gmail.com>2015-03-23 14:33:55 -0400
committerAvi Weinstock <aweinstock314@gmail.com>2015-03-23 18:28:44 -0400
commitcf0657a4030a3401845c83fe45c7e466d361292b (patch)
tree4a6582e75cd273ae8fe4237b0d468d6b64fdf631 /components/net/cookie.rs
parent5ce7d8accfc52dd37b19b4400a643a980412bb2f (diff)
downloadservo-cf0657a4030a3401845c83fe45c7e466d361292b.tar.gz
servo-cf0657a4030a3401845c83fe45c7e466d361292b.zip
Fixed some deprecation errors in components/net.
Diffstat (limited to 'components/net/cookie.rs')
-rw-r--r--components/net/cookie.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/net/cookie.rs b/components/net/cookie.rs
index a6390bf35c6..46094ac00a3 100644
--- a/components/net/cookie.rs
+++ b/components/net/cookie.rs
@@ -13,8 +13,9 @@ use time::{Tm, now, at, Timespec};
use url::Url;
use std::borrow::ToOwned;
use std::i64;
-use std::old_io::net::ip::IpAddr;
+use std::net::{Ipv4Addr, Ipv6Addr};
use std::time::Duration;
+use std::str::FromStr;
/// 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,
@@ -121,7 +122,8 @@ impl Cookie {
}
if string.ends_with(domain_string)
&& string.char_at(string.len()-domain_string.len()-1) == '.'
- && string.parse::<IpAddr>().is_err() {
+ && Ipv4Addr::from_str(string).is_err()
+ && Ipv6Addr::from_str(string).is_err() {
return true;
}
false