chore(nightly): remove ()'s and fix benchmarks for nightly

Also ensure that `cargo bench` runs successfully on travis; the old
`cargo bench ... || :` has the effect of ignoring any errors in it.
This commit is contained in:
Huon Wilson
2015-10-14 14:40:24 +11:00
parent cdaa2547ed
commit d2e9c94cf5
3 changed files with 14 additions and 2 deletions

12
benches/client.rs Normal file → Executable file
View File

@@ -7,6 +7,8 @@ extern crate test;
use std::fmt;
use std::io::{self, Read, Write, Cursor};
use std::net::SocketAddr;
#[cfg(feature = "timeouts")]
use std::time::Duration;
use hyper::net;
@@ -73,6 +75,16 @@ impl net::NetworkStream for MockStream {
fn peer_addr(&mut self) -> io::Result<SocketAddr> {
Ok("127.0.0.1:1337".parse().unwrap())
}
#[cfg(feature = "timeouts")]
fn set_read_timeout(&self, _: Option<Duration>) -> io::Result<()> {
// can't time out
Ok(())
}
#[cfg(feature = "timeouts")]
fn set_write_timeout(&self, _: Option<Duration>) -> io::Result<()> {
// can't time out
Ok(())
}
}
struct MockConnector;