diff --git a/src/compression.rs b/src/compression.rs index cbf73b79..9585ef3b 100644 --- a/src/compression.rs +++ b/src/compression.rs @@ -65,25 +65,14 @@ mod test { } } - #[cfg(all(not(feature = "bzip2"), feature = "deflate"))] fn methods() -> Vec { - vec![CompressionMethod::Stored, CompressionMethod::Deflated] + let mut methods = Vec::new(); + methods.push(CompressionMethod::Stored); + #[cfg(feature="deflate")] methods.push(CompressionMethod::Deflated); + #[cfg(feature="bzip2")] methods.push(CompressionMethod::Bzip2); + methods } - #[cfg(all(not(feature = "deflate"), feature = "bzip2"))] - fn methods() -> Vec { - vec![CompressionMethod::Stored, CompressionMethod::Bzip2] - } - - #[cfg(all(feature = "bzip2", feature = "deflate"))] - fn methods() -> Vec { - vec![CompressionMethod::Stored, CompressionMethod::Deflated, CompressionMethod::Bzip2] - } - - #[cfg(all(not(feature = "bzip2"), not(feature = "deflate")))] - fn methods() -> Vec { - vec![CompressionMethod::Stored] - } #[test] fn to_eq_from() {