diff --git a/src/client/conn/http1.rs b/src/client/conn/http1.rs index fb9a41da25..035271beb0 100644 --- a/src/client/conn/http1.rs +++ b/src/client/conn/http1.rs @@ -28,6 +28,7 @@ pub struct SendRequest { /// This allows taking apart a `Connection` at a later time, in order to /// reclaim the IO object, and additional related pieces. #[derive(Debug)] +#[non_exhaustive] pub struct Parts { /// The original IO object used in the handshake. pub io: T, @@ -40,7 +41,6 @@ pub struct Parts { /// You will want to check for any existing bytes if you plan to continue /// communicating on the IO object. pub read_buf: Bytes, - _inner: (), } /// A future that processes all HTTP state for the IO object. @@ -67,11 +67,7 @@ where /// Only works for HTTP/1 connections. HTTP/2 connections will panic. pub fn into_parts(self) -> Parts { let (io, read_buf, _) = self.inner.into_inner(); - Parts { - io, - read_buf, - _inner: (), - } + Parts { io, read_buf } } /// Poll the connection for completion, but without calling `shutdown` @@ -562,11 +558,7 @@ mod upgrades { match ready!(Pin::new(&mut self.inner.as_mut().unwrap().inner).poll(cx)) { Ok(proto::Dispatched::Shutdown) => Poll::Ready(Ok(())), Ok(proto::Dispatched::Upgrade(pending)) => { - let Parts { - io, - read_buf, - _inner, - } = self.inner.take().unwrap().into_parts(); + let Parts { io, read_buf } = self.inner.take().unwrap().into_parts(); pending.fulfill(Upgraded::new(io, read_buf)); Poll::Ready(Ok(())) } diff --git a/src/server/conn/http1.rs b/src/server/conn/http1.rs index d58a607c68..0147a6f38b 100644 --- a/src/server/conn/http1.rs +++ b/src/server/conn/http1.rs @@ -84,6 +84,7 @@ pub struct Builder { /// This allows taking apart a `Connection` at a later time, in order to /// reclaim the IO object, and additional related pieces. #[derive(Debug)] +#[non_exhaustive] pub struct Parts { /// The original IO object used in the handshake. pub io: T, @@ -98,7 +99,6 @@ pub struct Parts { pub read_buf: Bytes, /// The `Service` used to serve this connection. pub service: S, - _inner: (), } // ===== impl Connection ===== @@ -149,7 +149,6 @@ where io, read_buf, service: dispatch.into_service(), - _inner: (), } } diff --git a/src/upgrade.rs b/src/upgrade.rs index 3b7735c56d..5cd41ba083 100644 --- a/src/upgrade.rs +++ b/src/upgrade.rs @@ -80,6 +80,7 @@ pub struct OnUpgrade { /// Includes the original IO type, and a read buffer of bytes that the /// HTTP state machine may have already read before completing an upgrade. #[derive(Debug)] +#[non_exhaustive] pub struct Parts { /// The original IO object used before the upgrade. pub io: T, @@ -92,7 +93,6 @@ pub struct Parts { /// You will want to check for any existing bytes if you plan to continue /// communicating on the IO object. pub read_buf: Bytes, - _inner: (), } /// Gets a pending HTTP upgrade from this message. @@ -155,7 +155,6 @@ impl Upgraded { Ok(t) => Ok(Parts { io: *t, read_buf: buf, - _inner: (), }), Err(io) => Err(Upgraded { io: Rewind::new_buffered(io, buf),