Get the file extension for this format.
(&self)
| 168 | impl ArchiveFormat { |
| 169 | /// Get the file extension for this format. |
| 170 | pub fn extension(&self) -> &'static str { |
| 171 | match self { |
| 172 | Self::TarGz => ".tar.gz", |
| 173 | Self::Tar => ".tar", |
| 174 | Self::Directory => "", |
| 175 | Self::Zip => ".zip", |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /// Detect format from a path. |
| 180 | pub fn from_path(path: &Path) -> Option<Self> { |
no outgoing calls
no test coverage detected