diff --git a/hyper/src/body/body.rs b/hyper/src/body/body.rs index 02b9b69..859e4b8 100644 --- a/hyper/src/body/body.rs +++ b/hyper/src/body/body.rs @@ -6,14 +6,13 @@ use bytes::Bytes; use futures_channel::mpsc; use futures_channel::oneshot; use futures_core::Stream; -#[cfg(feature = "stream")] -use futures_util::TryStreamExt; + use http::HeaderMap; use http_body::{Body as HttpBody, SizeHint}; use super::DecodedLength; #[cfg(feature = "stream")] use crate::common::sync_wrapper::SyncWrapper; -use crate::common::Future; + #[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))] use crate::common::Never; use crate::common::{task, watch, Pin, Poll}; diff --git a/hyper/src/body/mod.rs b/hyper/src/body/mod.rs index cb11124..d3d9f8b 100644 --- a/hyper/src/body/mod.rs +++ b/hyper/src/body/mod.rs @@ -25,13 +25,6 @@ mod aggregate; mod body; mod length; mod to_bytes; -/// An optimization to try to take a full body if immediately available. -/// -/// This is currently limited to *only* `hyper::Body`s. -#[cfg(feature = "http1")] -pub(crate) fn take_full_data(body: &mut T) -> Option { - loop {} -} fn _assert_send_sync() { loop {} } diff --git a/hyper/src/body/to_bytes.rs b/hyper/src/body/to_bytes.rs index 802dc26..8a90fa3 100644 --- a/hyper/src/body/to_bytes.rs +++ b/hyper/src/body/to_bytes.rs @@ -1,4 +1,4 @@ -use bytes::{Buf, BufMut, Bytes}; +use bytes::{Bytes}; use super::HttpBody; /// Concatenate the buffers from a body into a single `Bytes` asynchronously. /// diff --git a/hyper/src/client/client.rs b/hyper/src/client/client.rs index 5445091..39de2a6 100644 --- a/hyper/src/client/client.rs +++ b/hyper/src/client/client.rs @@ -1,17 +1,17 @@ use std::error::Error as StdError; use std::fmt; -use std::mem; + use std::time::Duration; -use futures_channel::oneshot; + use futures_util::future::{self, Either, FutureExt as _, TryFutureExt as _}; -use http::header::{HeaderValue, HOST}; + use http::uri::{Port, Scheme}; -use http::{Method, Request, Response, Uri, Version}; -use tracing::{debug, trace, warn}; +use http::{Request, Response, Uri, Version}; +use tracing::{debug, trace}; use super::conn; use super::connect::{self, sealed::Connect, Alpn, Connected, Connection}; use super::pool::{ - self, CheckoutIsClosedError, Key as PoolKey, Pool, Poolable, Pooled, Reservation, + self, Key as PoolKey, Pool, Poolable, Pooled, Reservation, }; #[cfg(feature = "tcp")] use super::HttpConnector; diff --git a/hyper/src/client/conn.rs b/hyper/src/client/conn.rs index 649c888..e64601c 100644 --- a/hyper/src/client/conn.rs +++ b/hyper/src/client/conn.rs @@ -57,7 +57,7 @@ use std::error::Error as StdError; use std::fmt; #[cfg(not(all(feature = "http1", feature = "http2")))] use std::marker::PhantomData; -use std::sync::Arc; + #[cfg(all(feature = "runtime", feature = "http2"))] use std::time::Duration; use bytes::Bytes; @@ -77,8 +77,7 @@ use crate::common::{ }; use crate::proto; use crate::rt::Executor; -#[cfg(feature = "http1")] -use crate::upgrade::Upgraded; + use crate::{Body, Request, Response}; #[cfg(feature = "http1")] type Http1Dispatcher = proto::dispatch::Dispatcher< diff --git a/hyper/src/client/connect/dns.rs b/hyper/src/client/connect/dns.rs index 3327bbe..b2a0da4 100644 --- a/hyper/src/client/connect/dns.rs +++ b/hyper/src/client/connect/dns.rs @@ -24,7 +24,7 @@ use std::error::Error; use std::future::Future; use std::net::{ - Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs, + Ipv4Addr, Ipv6Addr, SocketAddr, }; use std::pin::Pin; use std::str::FromStr; @@ -32,7 +32,7 @@ use std::task::{self, Poll}; use std::{fmt, io, vec}; use tokio::task::JoinHandle; use tower_service::Service; -use tracing::debug; + pub(super) use self::sealed::Resolve; /// A domain name to resolve into IP addresses. #[derive(Clone, Hash, Eq, PartialEq)] diff --git a/hyper/src/client/connect/http.rs b/hyper/src/client/connect/http.rs index 6577e97..c029282 100644 --- a/hyper/src/client/connect/http.rs +++ b/hyper/src/client/connect/http.rs @@ -8,13 +8,13 @@ use std::pin::Pin; use std::sync::Arc; use std::task::{self, Poll}; use std::time::Duration; -use futures_util::future::Either; -use http::uri::{Scheme, Uri}; + +use http::uri::{Uri}; use pin_project_lite::pin_project; use tokio::net::{TcpSocket, TcpStream}; use tokio::time::Sleep; -use tracing::{debug, trace, warn}; -use super::dns::{self, resolve, GaiResolver, Resolve}; +use tracing::{warn}; +use super::dns::{self, GaiResolver, Resolve}; use super::{Connected, Connection}; /// A connector for the `http` scheme. /// diff --git a/hyper/src/client/dispatch.rs b/hyper/src/client/dispatch.rs index 949906a..cd1742c 100644 --- a/hyper/src/client/dispatch.rs +++ b/hyper/src/client/dispatch.rs @@ -1,9 +1,8 @@ #[cfg(feature = "http2")] use std::future::Future; -use futures_util::FutureExt; + use tokio::sync::{mpsc, oneshot}; -#[cfg(feature = "http2")] -use crate::common::Pin; + use crate::common::{task, Poll}; pub(crate) type RetryPromise = oneshot::Receiver< Result)>, diff --git a/hyper/src/client/pool.rs b/hyper/src/client/pool.rs index 62d7078..964c859 100644 --- a/hyper/src/client/pool.rs +++ b/hyper/src/client/pool.rs @@ -8,7 +8,7 @@ use std::time::{Duration, Instant}; use futures_channel::oneshot; #[cfg(feature = "runtime")] use tokio::time::{Duration, Instant, Interval}; -use tracing::{debug, trace}; + use super::client::Ver; use crate::common::{exec::Exec, task, Future, Pin, Poll, Unpin}; #[allow(missing_debug_implementations)] diff --git a/hyper/src/client/service.rs b/hyper/src/client/service.rs index 6d39897..330d97b 100644 --- a/hyper/src/client/service.rs +++ b/hyper/src/client/service.rs @@ -4,7 +4,7 @@ use std::error::Error as StdError; use std::future::Future; use std::marker::PhantomData; -use tracing::debug; + use super::conn::{Builder, SendRequest}; use crate::{ body::HttpBody, common::{task, Pin, Poll}, diff --git a/hyper/src/common/buf.rs b/hyper/src/common/buf.rs index 744e88b..b418829 100644 --- a/hyper/src/common/buf.rs +++ b/hyper/src/common/buf.rs @@ -1,6 +1,6 @@ use std::collections::VecDeque; use std::io::IoSlice; -use bytes::{Buf, BufMut, Bytes, BytesMut}; +use bytes::{Buf, Bytes}; pub(crate) struct BufList { bufs: VecDeque, } diff --git a/hyper/src/common/date.rs b/hyper/src/common/date.rs index 90f0520..a6a2337 100644 --- a/hyper/src/common/date.rs +++ b/hyper/src/common/date.rs @@ -1,10 +1,10 @@ use std::cell::RefCell; -use std::fmt::{self, Write}; +use std::fmt::{self}; use std::str; -use std::time::{Duration, SystemTime}; +use std::time::{SystemTime}; #[cfg(feature = "http2")] use http::header::HeaderValue; -use httpdate::HttpDate; + pub(crate) const DATE_VALUE_LENGTH: usize = 29; #[cfg(feature = "http1")] pub(crate) fn extend(dst: &mut Vec) { diff --git a/hyper/src/common/drain.rs b/hyper/src/common/drain.rs index 4b21fc6..2e8b311 100644 --- a/hyper/src/common/drain.rs +++ b/hyper/src/common/drain.rs @@ -1,4 +1,4 @@ -use std::mem; + use pin_project_lite::pin_project; use tokio::sync::watch; use super::{task, Future, Pin, Poll}; diff --git a/hyper/src/common/io/rewind.rs b/hyper/src/common/io/rewind.rs index aaf676f..e02d45c 100644 --- a/hyper/src/common/io/rewind.rs +++ b/hyper/src/common/io/rewind.rs @@ -1,6 +1,6 @@ use std::marker::Unpin; -use std::{cmp, io}; -use bytes::{Buf, Bytes}; +use std::{io}; +use bytes::{Bytes}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use crate::common::{task, Pin, Poll}; /// Combine a buffer with an IO, rewinding reads to use the buffer. diff --git a/hyper/src/common/watch.rs b/hyper/src/common/watch.rs index 62109b9..8c7b2ad 100644 --- a/hyper/src/common/watch.rs +++ b/hyper/src/common/watch.rs @@ -5,7 +5,7 @@ //! - The value `0` is reserved for closed. use futures_util::task::AtomicWaker; use std::sync::{ - atomic::{AtomicUsize, Ordering}, + atomic::{AtomicUsize}, Arc, }; use std::task; diff --git a/hyper/src/ext.rs b/hyper/src/ext.rs index b8246a2..c0ca6fe 100644 --- a/hyper/src/ext.rs +++ b/hyper/src/ext.rs @@ -11,8 +11,7 @@ use std::collections::HashMap; use std::fmt; #[cfg(any(feature = "http1", feature = "ffi"))] mod h1_reason_phrase; -#[cfg(any(feature = "http1", feature = "ffi"))] -pub(crate) use h1_reason_phrase::ReasonPhrase; + #[cfg(feature = "http2")] /// Represents the `:protocol` pseudo-header used by /// the [Extended CONNECT Protocol]. diff --git a/hyper/src/ext/h1_reason_phrase.rs b/hyper/src/ext/h1_reason_phrase.rs index ac80fde..59d469c 100644 --- a/hyper/src/ext/h1_reason_phrase.rs +++ b/hyper/src/ext/h1_reason_phrase.rs @@ -32,23 +32,7 @@ use bytes::Bytes; /// its contents will be written in place of the canonical reason phrase when responding via HTTP/1. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub(crate) struct ReasonPhrase(Bytes); -impl ReasonPhrase { - /// Gets the reason phrase as bytes. - pub(crate) fn as_bytes(&self) -> &[u8] { - loop {} - } - /// Converts a static byte slice to a reason phrase. - pub(crate) fn from_static(reason: &'static [u8]) -> Self { - loop {} - } - /// Converts a `Bytes` directly into a `ReasonPhrase` without validating. - /// - /// Use with care; invalid bytes in a reason phrase can cause serious security problems if - /// emitted in a response. - pub(crate) unsafe fn from_bytes_unchecked(reason: Bytes) -> Self { - loop {} - } -} +impl ReasonPhrase {} impl TryFrom<&[u8]> for ReasonPhrase { type Error = InvalidReasonPhrase; fn try_from(reason: &[u8]) -> Result { @@ -98,12 +82,6 @@ impl std::fmt::Display for InvalidReasonPhrase { } } impl std::error::Error for InvalidReasonPhrase {} -const fn is_valid_byte(b: u8) -> bool { - loop {} -} -const fn find_invalid_byte(bytes: &[u8]) -> Option { - loop {} -} #[cfg(test)] mod tests { use super::*; diff --git a/hyper/src/headers.rs b/hyper/src/headers.rs index 9b12b2a..45a6df4 100644 --- a/hyper/src/headers.rs +++ b/hyper/src/headers.rs @@ -1,6 +1,5 @@ -#[cfg(feature = "http1")] -use bytes::BytesMut; -use http::header::CONTENT_LENGTH; + + use http::header::{HeaderValue, ValueIter}; use http::HeaderMap; #[cfg(all(feature = "http2", feature = "client"))] diff --git a/hyper/src/proto/h1/conn.rs b/hyper/src/proto/h1/conn.rs index 1cf73ca..278e741 100644 --- a/hyper/src/proto/h1/conn.rs +++ b/hyper/src/proto/h1/conn.rs @@ -4,18 +4,18 @@ use std::marker::PhantomData; #[cfg(all(feature = "server", feature = "runtime"))] use std::time::Duration; use bytes::{Buf, Bytes}; -use http::header::{HeaderValue, CONNECTION}; + use http::{HeaderMap, Method, Version}; use httparse::ParserConfig; use tokio::io::{AsyncRead, AsyncWrite}; #[cfg(all(feature = "server", feature = "runtime"))] use tokio::time::Sleep; -use tracing::{debug, error, trace}; + use super::io::Buffered; -use super::{Decoder, Encode, EncodedBuf, Encoder, Http1Transaction, ParseContext, Wants}; +use super::{Decoder, EncodedBuf, Encoder, Http1Transaction, Wants}; use crate::body::DecodedLength; -use crate::common::{task, Pin, Poll, Unpin}; -use crate::headers::connection_keep_alive; +use crate::common::{task, Poll, Unpin}; + use crate::proto::{BodyLength, MessageHead}; const H2_PREFACE: &[u8] = b"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"; /// This handles a connection, which will have been established over an diff --git a/hyper/src/proto/h1/dispatch.rs b/hyper/src/proto/h1/dispatch.rs index 160eb40..5ef9d1f 100644 --- a/hyper/src/proto/h1/dispatch.rs +++ b/hyper/src/proto/h1/dispatch.rs @@ -2,12 +2,12 @@ use std::error::Error as StdError; use bytes::{Buf, Bytes}; use http::Request; use tokio::io::{AsyncRead, AsyncWrite}; -use tracing::{debug, trace}; -use super::{Http1Transaction, Wants}; -use crate::body::{Body, DecodedLength, HttpBody}; +use tracing::{trace}; +use super::{Http1Transaction}; +use crate::body::{Body, HttpBody}; use crate::common::{task, Future, Pin, Poll, Unpin}; -use crate::proto::{BodyLength, Conn, Dispatched, MessageHead, RequestHead}; -use crate::upgrade::OnUpgrade; +use crate::proto::{Conn, Dispatched, MessageHead, RequestHead}; + pub(crate) struct Dispatcher { conn: Conn, dispatch: D, diff --git a/hyper/src/proto/h1/encode.rs b/hyper/src/proto/h1/encode.rs index 60f9b79..bc00455 100644 --- a/hyper/src/proto/h1/encode.rs +++ b/hyper/src/proto/h1/encode.rs @@ -2,7 +2,7 @@ use std::fmt; use std::io::IoSlice; use bytes::buf::{Chain, Take}; use bytes::Buf; -use tracing::trace; + use super::io::WriteBuf; type StaticBuf = &'static [u8]; /// Encoders to handle different Transfer-Encodings. diff --git a/hyper/src/proto/h1/io.rs b/hyper/src/proto/h1/io.rs index fdb0d26..fe18508 100644 --- a/hyper/src/proto/h1/io.rs +++ b/hyper/src/proto/h1/io.rs @@ -1,20 +1,20 @@ -use std::cmp; + use std::fmt; #[cfg(all(feature = "server", feature = "runtime"))] use std::future::Future; use std::io::{self, IoSlice}; use std::marker::Unpin; -use std::mem::MaybeUninit; + #[cfg(all(feature = "server", feature = "runtime"))] use std::time::Duration; -use bytes::{Buf, BufMut, Bytes, BytesMut}; -use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; +use bytes::{Buf, Bytes, BytesMut}; +use tokio::io::{AsyncRead, AsyncWrite}; #[cfg(all(feature = "server", feature = "runtime"))] use tokio::time::Instant; -use tracing::{debug, trace}; + use super::{Http1Transaction, ParseContext, ParsedMessage}; use crate::common::buf::BufList; -use crate::common::{task, Pin, Poll}; +use crate::common::{task, Poll}; /// The initial buffer size allocated before trying to read from IO. pub(crate) const INIT_BUFFER_SIZE: usize = 8192; /// The minimum value that can be set to max buffer size. diff --git a/hyper/src/proto/h1/mod.rs b/hyper/src/proto/h1/mod.rs index 0f945c0..086defc 100644 --- a/hyper/src/proto/h1/mod.rs +++ b/hyper/src/proto/h1/mod.rs @@ -11,7 +11,7 @@ pub(crate) use self::conn::Conn; pub(crate) use self::decode::Decoder; pub(crate) use self::dispatch::Dispatcher; pub(crate) use self::encode::{EncodedBuf, Encoder}; -pub(crate) use self::io::MINIMUM_MAX_BUFFER_SIZE; + mod conn; mod decode; pub(crate) mod dispatch; diff --git a/hyper/src/proto/h1/role.rs b/hyper/src/proto/h1/role.rs index cb4f097..556d7bc 100644 --- a/hyper/src/proto/h1/role.rs +++ b/hyper/src/proto/h1/role.rs @@ -1,24 +1,22 @@ -use std::fmt::{self, Write}; +use std::fmt::{self}; use std::mem::MaybeUninit; -use bytes::Bytes; + use bytes::BytesMut; -#[cfg(feature = "server")] -use http::header::ValueIter; -use http::header::{self, Entry, HeaderName, HeaderValue}; -use http::{HeaderMap, Method, StatusCode, Version}; + +use http::header::{HeaderName}; +use http::{HeaderMap, Method, StatusCode}; #[cfg(all(feature = "server", feature = "runtime"))] use tokio::time::Instant; -use tracing::{debug, error, trace, trace_span, warn}; + use crate::body::DecodedLength; -#[cfg(feature = "server")] -use crate::common::date; + use crate::error::Parse; use crate::ext::HeaderCaseMap; #[cfg(feature = "ffi")] use crate::ext::OriginalHeaderOrder; -use crate::headers; + use crate::proto::h1::{ - Encode, Encoder, Http1Transaction, ParseContext, ParseResult, ParsedMessage, + Encode, Encoder, Http1Transaction, ParseContext, ParseResult, }; use crate::proto::{BodyLength, MessageHead, RequestHead, RequestLine}; const MAX_HEADERS: usize = 100; diff --git a/hyper/src/proto/h2/client.rs b/hyper/src/proto/h2/client.rs index adb713a..9962c46 100644 --- a/hyper/src/proto/h2/client.rs +++ b/hyper/src/proto/h2/client.rs @@ -1,24 +1,24 @@ use std::error::Error as StdError; #[cfg(feature = "runtime")] use std::time::Duration; -use bytes::Bytes; + use futures_channel::{mpsc, oneshot}; -use futures_util::future::{self, Either, FutureExt as _, TryFutureExt as _}; -use futures_util::stream::StreamExt as _; + + use h2::client::{Builder, SendRequest}; use h2::SendStream; -use http::{Method, StatusCode}; + use tokio::io::{AsyncRead, AsyncWrite}; -use tracing::{debug, trace, warn}; -use super::{ping, H2Upgraded, PipeToSendStream, SendBuf}; + +use super::{ping, SendBuf}; use crate::body::HttpBody; use crate::client::dispatch::Callback; use crate::common::{exec::Exec, task, Future, Never, Pin, Poll}; -use crate::ext::Protocol; -use crate::headers; -use crate::proto::h2::UpgradedSendStream; + + + use crate::proto::Dispatched; -use crate::upgrade::Upgraded; + use crate::{Body, Request, Response}; use h2::client::ResponseFuture; type ClientRx = crate::client::dispatch::Receiver, Response>; diff --git a/hyper/src/proto/h2/mod.rs b/hyper/src/proto/h2/mod.rs index 3e4093e..681aec9 100644 --- a/hyper/src/proto/h2/mod.rs +++ b/hyper/src/proto/h2/mod.rs @@ -1,14 +1,14 @@ use bytes::{Buf, Bytes}; -use h2::{Reason, RecvStream, SendStream}; -use http::header::{HeaderName, CONNECTION, TE, TRAILER, TRANSFER_ENCODING, UPGRADE}; +use h2::{RecvStream, SendStream}; + use http::HeaderMap; use pin_project_lite::pin_project; use std::error::Error as StdError; use std::io::{self, Cursor, IoSlice}; -use std::mem; + use std::task::Context; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; -use tracing::{debug, trace, warn}; + use crate::body::HttpBody; use crate::common::{task, Future, Pin, Poll}; use crate::proto::h2::ping::Recorder; diff --git a/hyper/src/proto/h2/ping.rs b/hyper/src/proto/h2/ping.rs index 1fa9586..38b2d16 100644 --- a/hyper/src/proto/h2/ping.rs +++ b/hyper/src/proto/h2/ping.rs @@ -29,10 +29,10 @@ use std::task::{self, Poll}; use std::time::Duration; #[cfg(not(feature = "runtime"))] use std::time::Instant; -use h2::{Ping, PingPong}; +use h2::{PingPong}; #[cfg(feature = "runtime")] use tokio::time::{Instant, Sleep}; -use tracing::{debug, trace}; + type WindowSize = u32; pub(super) fn disabled() -> Recorder { loop {} diff --git a/hyper/src/proto/h2/server.rs b/hyper/src/proto/h2/server.rs index a65028f..4088a03 100644 --- a/hyper/src/proto/h2/server.rs +++ b/hyper/src/proto/h2/server.rs @@ -2,24 +2,24 @@ use std::error::Error as StdError; use std::marker::Unpin; #[cfg(feature = "runtime")] use std::time::Duration; -use bytes::Bytes; + use h2::server::{Connection, Handshake, SendResponse}; -use h2::{Reason, RecvStream}; -use http::{Method, Request}; +use h2::{RecvStream}; + use pin_project_lite::pin_project; use tokio::io::{AsyncRead, AsyncWrite}; -use tracing::{debug, trace, warn}; + use super::{ping, PipeToSendStream, SendBuf}; use crate::body::HttpBody; use crate::common::exec::ConnStreamExec; -use crate::common::{date, task, Future, Pin, Poll}; -use crate::ext::Protocol; -use crate::headers; +use crate::common::{task, Future, Pin, Poll}; + + use crate::proto::h2::ping::Recorder; -use crate::proto::h2::{H2Upgraded, UpgradedSendStream}; + use crate::proto::Dispatched; use crate::service::HttpService; -use crate::upgrade::{OnUpgrade, Pending, Upgraded}; +use crate::upgrade::{Pending}; use crate::{Body, Response}; const DEFAULT_CONN_WINDOW: u32 = 1024 * 1024; const DEFAULT_STREAM_WINDOW: u32 = 1024 * 1024; diff --git a/hyper/src/server/conn.rs b/hyper/src/server/conn.rs index e11f1e2..d85fb1e 100644 --- a/hyper/src/server/conn.rs +++ b/hyper/src/server/conn.rs @@ -53,10 +53,8 @@ use std::marker::PhantomData; use std::time::Duration; #[cfg(feature = "http2")] use crate::common::io::Rewind; -#[cfg(all(feature = "http1", feature = "http2"))] -use crate::error::{Kind, Parse}; -#[cfg(feature = "http1")] -use crate::upgrade::Upgraded; + + cfg_feature! { #![any(feature = "http1", feature = "http2")] use std::error::Error as StdError; use std::fmt; use bytes::Bytes; use pin_project_lite::pin_project; use tokio::io:: { diff --git a/hyper/src/server/server.rs b/hyper/src/server/server.rs index 698fa03..2ba2a1c 100644 --- a/hyper/src/server/server.rs +++ b/hyper/src/server/server.rs @@ -6,7 +6,7 @@ use std::net::{SocketAddr, TcpListener as StdTcpListener}; use std::time::Duration; use pin_project_lite::pin_project; use tokio::io::{AsyncRead, AsyncWrite}; -use tracing::trace; + use super::accept::Accept; #[cfg(all(feature = "tcp"))] use super::tcp::AddrIncoming; @@ -467,7 +467,7 @@ where pub(crate) mod new_svc { use std::error::Error as StdError; use tokio::io::{AsyncRead, AsyncWrite}; - use tracing::debug; + use super::{Connecting, Watcher}; use crate::body::{Body, HttpBody}; use crate::common::exec::ConnStreamExec; diff --git a/hyper/src/server/shutdown.rs b/hyper/src/server/shutdown.rs index d3a9e70..c716ef3 100644 --- a/hyper/src/server/shutdown.rs +++ b/hyper/src/server/shutdown.rs @@ -1,12 +1,12 @@ use std::error::Error as StdError; use pin_project_lite::pin_project; use tokio::io::{AsyncRead, AsyncWrite}; -use tracing::debug; + use super::accept::Accept; use super::conn::UpgradeableConnection; use super::server::{Server, Watcher}; use crate::body::{Body, HttpBody}; -use crate::common::drain::{self, Draining, Signal, Watch, Watching}; +use crate::common::drain::{Draining, Signal, Watch, Watching}; use crate::common::exec::{ConnStreamExec, NewSvcExec}; use crate::common::{task, Future, Pin, Poll, Unpin}; use crate::service::{HttpService, MakeServiceRef}; diff --git a/hyper/src/server/tcp.rs b/hyper/src/server/tcp.rs index 3a40b83..0e9e9af 100644 --- a/hyper/src/server/tcp.rs +++ b/hyper/src/server/tcp.rs @@ -5,8 +5,8 @@ use std::time::Duration; use socket2::TcpKeepalive; use tokio::net::TcpListener; use tokio::time::Sleep; -use tracing::{debug, error, trace}; -use crate::common::{task, Future, Pin, Poll}; + +use crate::common::{task, Pin, Poll}; #[allow(unreachable_pub)] pub use self::addr_stream::AddrStream; use super::accept::Accept; diff --git a/hyper/src/service/mod.rs b/hyper/src/service/mod.rs index 22f850c..93ec3be 100644 --- a/hyper/src/service/mod.rs +++ b/hyper/src/service/mod.rs @@ -49,7 +49,7 @@ pub(super) use self::make::MakeConnection; #[cfg(all(any(feature = "http1", feature = "http2"), feature = "server"))] pub(super) use self::make::MakeServiceRef; #[cfg(all(any(feature = "http1", feature = "http2"), feature = "client"))] -pub(super) use self::oneshot::{oneshot, Oneshot}; +pub(super) use self::oneshot::{Oneshot}; pub use self::make::make_service_fn; pub use self::util::service_fn; diff --git a/hyper/src/upgrade.rs b/hyper/src/upgrade.rs index 5f4aed0..000e8c3 100644 --- a/hyper/src/upgrade.rs +++ b/hyper/src/upgrade.rs @@ -46,8 +46,7 @@ use std::marker::Unpin; use bytes::Bytes; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tokio::sync::oneshot; -#[cfg(any(feature = "http1", feature = "http2"))] -use tracing::trace; + use crate::common::io::Rewind; use crate::common::{task, Future, Pin, Poll}; /// An upgraded HTTP connection.