diff --git a/lib/src/config/config.rs b/lib/src/config/config.rs index 3530cd24..fd1544e8 100644 --- a/lib/src/config/config.rs +++ b/lib/src/config/config.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; -use std::net::{IpAddr, lookup_host}; +use std::net::ToSocketAddrs; use std::path::{Path, PathBuf}; use std::convert::AsRef; use std::fmt; @@ -344,7 +344,7 @@ impl Config { /// ``` pub fn set_address>(&mut self, address: A) -> Result<()> { let address = address.into(); - if address.parse::().is_err() && lookup_host(&address).is_err() { + if (address.as_ref(), 0u16).to_socket_addrs().is_err() { return Err(self.bad_type("address", "string", "a valid hostname or IP")); } diff --git a/lib/src/lib.rs b/lib/src/lib.rs index f0f5061b..f96f11bf 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -2,7 +2,6 @@ #![feature(conservative_impl_trait)] #![feature(drop_types_in_const)] #![feature(const_fn)] -#![feature(lookup_host)] #![feature(plugin)] #![feature(never_type)] #![feature(try_trait)]