Skip to content

Commit

Permalink
Merge branch 'master' of github.com:google/tarpc into doc-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tikue committed Feb 17, 2017
2 parents 7ae107c + 12efcae commit eac6b64
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -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... "
Expand Down Expand Up @@ -125,6 +127,7 @@ else

run_cargo build
run_cargo test
run_cargo bench
fi

exit $PREPUSH_RESULT
21 changes: 1 addition & 20 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -138,22 +138,3 @@ fn listener(addr: &SocketAddr, handle: &Handle) -> io::Result<TcpListener> {
.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<io::Result<SocketAddr>, futures::Canceled>,
}

impl Future for ListenFuture {
type Item = SocketAddr;
type Error = io::Error;

fn poll(&mut self) -> futures::Poll<Self::Item, Self::Error> {
// 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),
}
}
}

0 comments on commit eac6b64

Please sign in to comment.