From 4fc37fe70797988a22f3b9e6b2aee2fbee093579 Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Thu, 16 Feb 2017 00:46:43 -0800 Subject: [PATCH 1/3] Add bench to pre-push and .travis.yml --- .travis.yml | 4 ++-- hooks/pre-push | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad81c00..f240e47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,8 @@ before_script: script: - | - travis-cargo build && travis-cargo test && - travis-cargo build -- --features tls && travis-cargo test -- --features tls + travis-cargo build && travis-cargo test && travis-cargo bench && + travis-cargo build -- --features tls && travis-cargo test -- --features tls && travis-cargo bench -- --features tls after_success: - travis-cargo coveralls --no-sudo diff --git a/hooks/pre-push b/hooks/pre-push index b3ddbfe..0d8d52a 100755 --- a/hooks/pre-push +++ b/hooks/pre-push @@ -61,8 +61,10 @@ PREPUSH_RESULT=0 run_cargo() { if [ "$1" == "build" ]; then VERB=Building - else + elif [ "$1" == "test" ]; then VERB=Testing + else + VERB=Benching fi if [ "$2" != "" ]; then printf "${PREFIX} $VERB on $2... " @@ -125,6 +127,7 @@ else run_cargo build run_cargo test + run_cargo bench fi exit $PREPUSH_RESULT From 517477129cdee6d9eada1e9c9514cd9b18ba41bf Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Thu, 16 Feb 2017 01:00:40 -0800 Subject: [PATCH 2/3] Remove dead code --- src/server.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/server.rs b/src/server.rs index 1e1b4e6..53f01e6 100644 --- a/src/server.rs +++ b/src/server.rs @@ -138,22 +138,3 @@ fn listener(addr: &SocketAddr, handle: &Handle) -> io::Result { .listen(PENDING_CONNECTION_BACKLOG) .and_then(|l| TcpListener::from_listener(l, addr, handle)) } - -/// A future that resolves to a `ServerHandle`. -#[doc(hidden)] -pub struct ListenFuture { - inner: future::FutureResult, futures::Canceled>, -} - -impl Future for ListenFuture { - type Item = SocketAddr; - type Error = io::Error; - - fn poll(&mut self) -> futures::Poll { - // Can't panic the oneshot is always completed. - match self.inner.poll().unwrap() { - Async::Ready(result) => result.map(Async::Ready), - Async::NotReady => Ok(Async::NotReady), - } - } -} From 30eed41c40f8e88d416d86d6e62b3dd7df8bf4a8 Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Thu, 16 Feb 2017 01:04:40 -0800 Subject: [PATCH 3/3] Unused imports --- src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.rs b/src/server.rs index 53f01e6..5016376 100644 --- a/src/server.rs +++ b/src/server.rs @@ -5,7 +5,7 @@ use bincode; use errors::WireError; -use futures::{self, Async, Future, Stream, future}; +use futures::{Future, Stream, future}; use net2; use protocol::Proto; use serde::{Deserialize, Serialize};