Merge pull request #665 from huonw/nightly

chore(nightly): remove ()'s and fix benchmarks for nightly
This commit is contained in:
Sean McArthur
2015-10-13 21:28:24 -07:00
3 changed files with 14 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ cache:
script: script:
- cargo build --verbose $FEATURES - cargo build --verbose $FEATURES
- cargo test --verbose $FEATURES - cargo test --verbose $FEATURES
- '[ $TRAVIS_RUST_VERSION = nightly ] && cargo bench --no-run || :' - 'if [ $TRAVIS_RUST_VERSION = nightly ]; then cargo bench --no-run; fi'
addons: addons:
apt: apt:

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

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

View File

@@ -27,7 +27,7 @@ impl<A: NetworkListener + Send + 'static> ListenerPool<A> {
let work = Arc::new(work); let work = Arc::new(work);
// Begin work. // Begin work.
for _ in (0..threads) { for _ in 0..threads {
spawn_with(super_tx.clone(), work.clone(), self.acceptor.clone()) spawn_with(super_tx.clone(), work.clone(), self.acceptor.clone())
} }