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

@@ -28,9 +28,9 @@ fn hyper_handle(mut incoming: hyper::server::Incoming) {
#[bench]
fn bench_hyper(b: &mut Bencher) {
let server = hyper::Server::http(Ipv4Addr(127, 0, 0, 1), 0);
let listener = server.listen(hyper_handle).unwrap();
let mut listener = server.listen(hyper_handle).unwrap();
let url = hyper::Url::parse(format!("http://{}", listener.socket_addr).as_slice()).unwrap();
let url = hyper::Url::parse(format!("http://{}", listener.sockets[0]).as_slice()).unwrap();
b.iter(|| request(url.clone()));
listener.close().unwrap();
}