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
+3 -2
View File
@@ -42,12 +42,13 @@ use std::io;
/// ```
///
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Default)]
pub struct BytesCodec(());
#[non_exhaustive]
pub struct BytesCodec;
impl BytesCodec {
/// Creates a new `BytesCodec` for shipping around raw bytes.
pub fn new() -> BytesCodec {
BytesCodec(())
BytesCodec
}
}