mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 20:15:27 +00:00
Introduce is_archive_format
method on CompressionFormat
This commit is contained in:
parent
a46fa1fb38
commit
340827de1f
@ -19,6 +19,12 @@ pub enum CompressionFormat {
|
|||||||
Zip, // .zip
|
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 {
|
impl fmt::Display for CompressionFormat {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(
|
write!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user