Split Server::listen into two methods to hack around ICE related to default type params

Trying to default the type parameters leads to an ICE and strange type errors.
I think this is just due to the experimental state of default type params and
this change can be rolled back when they are fixed.
This commit is contained in:
Jonathan Reem
2014-09-10 12:13:18 -07:00
parent 0c674a1376
commit cfd5cf3c68
4 changed files with 20 additions and 13 deletions

View File

@@ -8,9 +8,8 @@ extern crate test;
use std::fmt::{mod, Show};
use std::io::net::ip::Ipv4Addr;
use hyper::server::{Incoming, Server};
use hyper::net::HttpAcceptor;
fn listen() -> hyper::server::Listening<HttpAcceptor> {
fn listen() -> hyper::server::Listening {
let server = Server::http(Ipv4Addr(127, 0, 0, 1), 0);
server.listen(handle).unwrap()
}
@@ -70,11 +69,11 @@ fn bench_hyper(b: &mut test::Bencher) {
let mut req = hyper::get(hyper::Url::parse(url).unwrap()).unwrap();
req.headers.set(Foo);
req
.send().unwrap()
.read_to_string().unwrap()
req
.send().unwrap()
.read_to_string().unwrap()
});
listening.close().unwrap()
listening.close().unwrap()
}
#[bench]