chore: use #[non_exhaustive] instead of private unit field (#3320)

This commit is contained in:
Taiki Endo
2020-12-23 22:48:33 +09:00
committed by GitHub
parent 0deaeb8494
commit 575938d457
15 changed files with 43 additions and 55 deletions
+1 -7
View File
@@ -219,7 +219,6 @@ impl<T, U> Framed<T, U> {
codec: self.inner.codec,
read_buf: self.inner.state.read.buffer,
write_buf: self.inner.state.write.buffer,
_priv: (),
}
}
}
@@ -282,7 +281,7 @@ where
///
/// [`Framed`]: crate::codec::Framed
#[derive(Debug)]
#[allow(clippy::manual_non_exhaustive)]
#[non_exhaustive]
pub struct FramedParts<T, U> {
/// The inner transport used to read bytes to and write bytes to
pub io: T,
@@ -295,10 +294,6 @@ pub struct FramedParts<T, U> {
/// A buffer with unprocessed data which are not written yet.
pub write_buf: BytesMut,
/// This private field allows us to add additional fields in the future in a
/// backwards compatible way.
_priv: (),
}
impl<T, U> FramedParts<T, U> {
@@ -312,7 +307,6 @@ impl<T, U> FramedParts<T, U> {
codec,
read_buf: BytesMut::new(),
write_buf: BytesMut::new(),
_priv: (),
}
}
}