Merge branch 'feature/supported-methods' into feature/end-to-end-all-methods

This commit is contained in:
Jack Fletcher 2022-01-30 20:43:44 +00:00
commit b4224503d5
2 changed files with 16 additions and 16 deletions

View file

@ -131,23 +131,23 @@ impl fmt::Display for CompressionMethod {
} }
/// The compression methods which have been implemented. /// The compression methods which have been implemented.
pub const SUPPORTED_METHODS: &[CompressionMethod] = &[ pub const SUPPORTED_COMPRESSION_METHODS: &[CompressionMethod] = &[
CompressionMethod::Stored, CompressionMethod::Stored,
#[cfg(any( #[cfg(any(
feature = "deflate", feature = "deflate",
feature = "deflate-miniz", feature = "deflate-miniz",
feature = "deflate-zlib" feature = "deflate-zlib"
))] ))]
CompressionMethod::Deflated, CompressionMethod::Deflated,
#[cfg(feature = "bzip2")] #[cfg(feature = "bzip2")]
CompressionMethod::Bzip2, CompressionMethod::Bzip2,
#[cfg(feature = "zstd")] #[cfg(feature = "zstd")]
CompressionMethod::Zstd, CompressionMethod::Zstd,
]; ];
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use super::{CompressionMethod, SUPPORTED_METHODS}; use super::{CompressionMethod, SUPPORTED_COMPRESSION_METHODS};
#[test] #[test]
fn from_eq_to() { fn from_eq_to() {
@ -172,7 +172,7 @@ mod test {
assert_eq!(to, back); assert_eq!(to, back);
} }
for &method in SUPPORTED_METHODS { for &method in SUPPORTED_COMPRESSION_METHODS {
check_match(method); check_match(method);
} }
} }
@ -185,7 +185,7 @@ mod test {
assert_eq!(debug_str, display_str); assert_eq!(debug_str, display_str);
} }
for &method in SUPPORTED_METHODS { for &method in SUPPORTED_COMPRESSION_METHODS {
check_match(method); check_match(method);
} }
} }

View file

@ -5,7 +5,7 @@
#![warn(missing_docs)] #![warn(missing_docs)]
pub use crate::compression::{CompressionMethod, SUPPORTED_METHODS}; pub use crate::compression::{CompressionMethod, SUPPORTED_COMPRESSION_METHODS};
pub use crate::read::ZipArchive; pub use crate::read::ZipArchive;
pub use crate::types::DateTime; pub use crate::types::DateTime;
pub use crate::write::ZipWriter; pub use crate::write::ZipWriter;