Skip to content

Commit 29fcc7f

Browse files
authored
chore(server): Remove import sleep and pending function (#2234)
1 parent 0e6c9cb commit 29fcc7f

File tree

1 file changed

+2
-4
lines changed
  • tonic/src/transport/server

1 file changed

+2
-4
lines changed

tonic/src/transport/server/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ use http::{Request, Response};
5050
use http_body_util::BodyExt;
5151
use hyper::{body::Incoming, service::Service as HyperService};
5252
use pin_project::pin_project;
53-
use std::future::pending;
5453
use std::{
5554
fmt,
5655
future::{self, poll_fn, Future},
@@ -62,7 +61,6 @@ use std::{
6261
time::Duration,
6362
};
6463
use tokio::io::{AsyncRead, AsyncWrite};
65-
use tokio::time::sleep;
6664
use tokio_stream::Stream;
6765
use tower::{
6866
layer::util::{Identity, Stack},
@@ -816,8 +814,8 @@ fn serve_connection<B, IO, S, E>(
816814

817815
async fn sleep_or_pending(wait_for: Option<Duration>) {
818816
match wait_for {
819-
Some(wait) => sleep(wait).await,
820-
None => pending().await,
817+
Some(wait) => tokio::time::sleep(wait).await,
818+
None => future::pending().await,
821819
};
822820
}
823821

0 commit comments

Comments
 (0)