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,4 +1,4 @@
#![feature(core, collections, io, net,
#![feature(core, collections, io,
std_misc, box_syntax, unsafe_destructor)]
#![deny(missing_docs)]
#![cfg_attr(test, deny(warnings))]

View File

@@ -215,8 +215,8 @@ impl NetworkListener for HttpListener {
#[inline]
fn socket_addr(&mut self) -> io::Result<SocketAddr> {
match *self {
HttpListener::Http(ref mut tcp) => tcp.socket_addr(),
HttpListener::Https(ref mut tcp, _) => tcp.socket_addr(),
HttpListener::Http(ref mut tcp) => tcp.local_addr(),
HttpListener::Https(ref mut tcp, _) => tcp.local_addr(),
}
}
}

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)
}
}