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.
This commit is contained in:
@@ -8,8 +8,9 @@ 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 {
|
||||
fn listen() -> hyper::server::Listening<HttpAcceptor> {
|
||||
let server = Server::http(Ipv4Addr(127, 0, 0, 1), 0);
|
||||
server.listen(handle).unwrap()
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ use std::io::net::ip::{IpAddr, Port, SocketAddr};
|
||||
pub use self::request::Request;
|
||||
pub use self::response::{Response, Fresh, Streaming};
|
||||
|
||||
use net::{NetworkListener, NetworkAcceptor, NetworkStream};
|
||||
use net::HttpListener;
|
||||
use net::{NetworkListener, NetworkAcceptor, NetworkStream, HttpAcceptor, HttpListener};
|
||||
|
||||
pub mod request;
|
||||
pub mod response;
|
||||
@@ -60,7 +59,7 @@ impl<L: NetworkListener<S, A>, S: NetworkStream, A: NetworkAcceptor<S>> Server<L
|
||||
|
||||
/// An iterator over incoming connections, represented as pairs of
|
||||
/// hyper Requests and Responses.
|
||||
pub struct Incoming<'a, A: 'a> {
|
||||
pub struct Incoming<'a, A: 'a = HttpAcceptor> {
|
||||
from: IncomingConnections<'a, A>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user