Skip to content

Commit

Permalink
style(server): remove FutureExt::boxed to unify project style
Browse files Browse the repository at this point in the history
  • Loading branch information
AtkinsChang committed Sep 3, 2019
1 parent 5cb42a2 commit 21d44e3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/server/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::net::{SocketAddr, TcpListener as StdTcpListener};
use std::time::Duration;

use futures_core::Stream;
use futures_util::FutureExt as _;
use tokio_net::driver::Handle;
use tokio_net::tcp::TcpListener;
use tokio_timer::Delay;
Expand Down Expand Up @@ -106,10 +105,9 @@ impl AddrIncoming {
}
self.timeout = None;

let mut accept_fut = self.listener.accept().boxed();

let mut accept = self.listener.accept();
loop {
match accept_fut.poll_unpin(cx) {
match unsafe { Pin::new_unchecked(&mut accept) }.poll(cx) {
Poll::Ready(Ok((socket, addr))) => {
if let Some(dur) = self.tcp_keepalive_timeout {
if let Err(e) = socket.set_keepalive(Some(dur)) {
Expand Down

0 comments on commit 21d44e3

Please sign in to comment.