mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-18 23:49:09 +00:00
Remove reliance on 'lookup_host'.
This commit is contained in:
parent
329711db3b
commit
bd08d50f59
@ -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<A: Into<String>>(&mut self, address: A) -> Result<()> {
|
||||
let address = address.into();
|
||||
if address.parse::<IpAddr>().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"));
|
||||
}
|
||||
|
||||
|
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user