Fixed some deprecation errors in components/net.

This commit is contained in:
Avi Weinstock 2015-03-23 14:33:55 -04:00
parent 5ce7d8accf
commit cf0657a403
3 changed files with 18 additions and 21 deletions

View file

@ -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