Fix warning: Stop to use deprecated 'SocketAddr::new'

This commit is contained in:
Tetsuharu OHZEKI 2015-12-11 10:39:23 -05:00
parent 196f15b696
commit 4906b38af9

View file

@ -5,7 +5,7 @@
#![crate_name = "webdriver_server"] #![crate_name = "webdriver_server"]
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![feature(ip_addr, plugin)] #![feature(plugin)]
#![plugin(plugins)] #![plugin(plugins)]
extern crate compositing; extern crate compositing;
@ -37,7 +37,7 @@ use rustc_serialize::base64::{CharacterSet, Config, Newline, ToBase64};
use rustc_serialize::json::{Json, ToJson}; use rustc_serialize::json::{Json, ToJson};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::net::SocketAddr; use std::net::{SocketAddr, SocketAddrV4};
use std::sync::mpsc::Sender; use std::sync::mpsc::Sender;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
@ -63,7 +63,8 @@ fn extension_routes() -> Vec<(Method, &'static str, ServoExtensionRoute)> {
pub fn start_server(port: u16, constellation_chan: Sender<ConstellationMsg>) { pub fn start_server(port: u16, constellation_chan: Sender<ConstellationMsg>) {
let handler = Handler::new(constellation_chan); let handler = Handler::new(constellation_chan);
spawn_named("WebdriverHttpServer".to_owned(), move || { spawn_named("WebdriverHttpServer".to_owned(), move || {
server::start(SocketAddr::new("0.0.0.0".parse().unwrap(), port), handler, let address = SocketAddrV4::new("0.0.0.0".parse().unwrap(), port);
server::start(SocketAddr::V4(address), handler,
extension_routes()); extension_routes());
}); });
} }