fix(rustup): adapt to current rustc

Closes #381.
This commit is contained in:
Adrian Heine
2015-03-19 09:17:15 +01:00
parent 7469e62d1e
commit 1f0bc951c9
7 changed files with 14 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
//! HTTP Server
use std::io::{BufReader, BufWriter, Write};
use std::marker::PhantomData;
use std::net::{IpAddr, SocketAddr};
use std::net::{Ipv4Addr, SocketAddr};
use std::path::Path;
use std::thread::{self, JoinGuard};
@@ -76,7 +76,7 @@ impl<'a, H: Handler + 'static> Server<'a, H, HttpListener> {
impl<'a, H: Handler + 'static> Server<'a, H, HttpListener> {
/// Binds to a socket, and starts handling connections using a task pool.
pub fn listen_threads(self, ip: IpAddr, port: u16, threads: usize) -> HttpResult<Listening> {
pub fn listen_threads(self, ip: Ipv4Addr, port: u16, threads: usize) -> HttpResult<Listening> {
let addr = &(ip, port);
let listener = try!(match self.ssl {
Some((cert, key)) => HttpListener::https(addr, cert, key),
@@ -86,7 +86,7 @@ impl<'a, H: Handler + 'static> Server<'a, H, HttpListener> {
}
/// Binds to a socket and starts handling connections.
pub fn listen(self, ip: IpAddr, port: u16) -> HttpResult<Listening> {
pub fn listen(self, ip: Ipv4Addr, port: u16) -> HttpResult<Listening> {
self.listen_threads(ip, port, num_cpus::get() * 5 / 4)
}
}