Skip to content

Commit 6bad66a

Browse files
committed
Update benchmarks and introduce more default type params for remaining generics
The client benchmarks did not have to be changed at all for this whole refactor, and the server benchmark only had to specify a single type parameter, and only because it writes out the type of Listener, which is not normal usage.
1 parent d2946a6 commit 6bad66a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

benches/client.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ extern crate test;
88
use std::fmt::{mod, Show};
99
use std::io::net::ip::Ipv4Addr;
1010
use hyper::server::{Incoming, Server};
11+
use hyper::net::HttpAcceptor;
1112

12-
fn listen() -> hyper::server::Listening {
13+
fn listen() -> hyper::server::Listening<HttpAcceptor> {
1314
let server = Server::http(Ipv4Addr(127, 0, 0, 1), 0);
1415
server.listen(handle).unwrap()
1516
}

src/server/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use std::io::net::ip::{IpAddr, Port, SocketAddr};
55
pub use self::request::Request;
66
pub use self::response::{Response, Fresh, Streaming};
77

8-
use net::{NetworkListener, NetworkAcceptor, NetworkStream};
9-
use net::HttpListener;
8+
use net::{NetworkListener, NetworkAcceptor, NetworkStream, HttpAcceptor, HttpListener};
109

1110
pub mod request;
1211
pub mod response;
@@ -60,7 +59,7 @@ impl<L: NetworkListener<S, A>, S: NetworkStream, A: NetworkAcceptor<S>> Server<L
6059

6160
/// An iterator over incoming connections, represented as pairs of
6261
/// hyper Requests and Responses.
63-
pub struct Incoming<'a, A: 'a> {
62+
pub struct Incoming<'a, A: 'a = HttpAcceptor> {
6463
from: IncomingConnections<'a, A>
6564
}
6665

0 commit comments

Comments
 (0)