Skip to content

Commit 634f3ee

Browse files
committed
add back to display trait for CompressionType
1 parent 91bba6a commit 634f3ee

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/compression.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ pub enum CompressionType {
2222
Lz4,
2323
}
2424

25+
impl std::fmt::Display for CompressionType {
26+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27+
write!(
28+
f,
29+
"{}",
30+
match self {
31+
Self::None => "none",
32+
33+
#[cfg(feature = "lz4")]
34+
Self::Lz4 => "lz4",
35+
}
36+
)
37+
}
38+
}
39+
2540
impl Encode for CompressionType {
2641
fn encode_into<W: Write>(&self, writer: &mut W) -> Result<(), crate::Error> {
2742
match self {

0 commit comments

Comments
 (0)