Skip to content

Commit 2abab4b

Browse files
committed
fix impl Default for CompressionMethod
1 parent 467698b commit 2abab4b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

compress/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ impl CompressionMethod {
8181
}
8282
}
8383

84+
#[cfg(any(feature = "deflate", feature = "zstd"))]
85+
impl Default for CompressionMethod {
86+
fn default() -> Self {
87+
#[cfg(feature = "deflate")]
88+
{
89+
Self::Deflate
90+
}
91+
#[cfg(all(not(feature = "deflate"), feature = "zstd"))]
92+
{
93+
Self::Zstd
94+
}
95+
}
96+
}
97+
8498
pub enum FlateEncoder<W: Write> {
8599
#[cfg(feature = "deflate")]
86100
Deflate(DeflateEncoder<W>),

0 commit comments

Comments
 (0)