diff --git a/src/types.rs b/src/types.rs index ab8d22da..4dc66386 100644 --- a/src/types.rs +++ b/src/types.rs @@ -362,6 +362,14 @@ pub struct ZipFileData { } impl ZipFileData { + #[allow(dead_code)] + pub fn is_dir(&self) -> bool { + self.file_name + .chars() + .next_back() + .map_or(false, |c| c == '/' || c == '\\') + } + pub fn file_name_sanitized(&self) -> PathBuf { let no_null_filename = match self.file_name.find('\0') { Some(index) => &self.file_name[0..index],