Introduce is_archive_format method on CompressionFormat

This commit is contained in:
Spyros Roum 2021-10-21 19:17:14 +03:00
parent a46fa1fb38
commit 340827de1f

View File

@ -19,6 +19,12 @@ pub enum CompressionFormat {
Zip, // .zip
}
impl CompressionFormat {
pub fn is_archive_format(&self) -> bool {
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zstd | Zip)
}
}
impl fmt::Display for CompressionFormat {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(