···1212 self.name()
1313 }
14141515+ /// Detect if the input is an archive of this type
1616+ #[allow(dead_code)]
1717+ fn is_archive(&self, in_path: &Path) -> bool {
1818+ in_path.extension().unwrap_or_default() == self.extension()
1919+ }
2020+1521 /// Generate the default name for the compressed file
1622 fn default_compressed_filename(&self, in_path: &Path) -> String {
1723 format!(
···2127 )
2228 }
23292424- // Generate the default extracted filename
3030+ /// Generate the default extracted filename
2531 fn default_extracted_filename(&self, in_path: &Path) -> String {
3232+ // If the file has the extension for this type, return the filename without the extension
3333+ if in_path.extension().unwrap() == self.extension() {
3434+ return in_path.file_stem().unwrap().to_str().unwrap().to_string();
3535+ }
2636 // If the file has no extension, return the current directory
2737 if in_path.extension().is_none() {
2838 return ".".to_string();
2939 }
3030- // Otherwise, return the filename without the extension
3131- in_path.file_stem().unwrap().to_str().unwrap().to_string()
4040+ // Otherwise, return the current directory and hope for the best
4141+ ".".to_string()
3242 }
33433444 fn compress(&self, input: CmprssInput, output: CmprssOutput) -> Result<(), io::Error> {