diff --git a/src/read.rs b/src/read.rs index 4a68d79e..75f24839 100644 --- a/src/read.rs +++ b/src/read.rs @@ -703,6 +703,7 @@ impl ZipArchive { "Invalid UTF-8 as symlink target", )); }; + let target = target.into_boxed_str(); let target_is_dir_from_archive = self.shared.files.contains_key(&target) && is_dir(&target); let target_internal_path: PathBuf = target.into(); diff --git a/src/spec.rs b/src/spec.rs index 893228e4..7b238c50 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -227,7 +227,7 @@ impl Zip64CentralDirectoryEnd { } } -pub(crate) fn is_dir(filename: &str) -> bool { +pub(crate) fn is_dir>(filename: T) -> bool { filename .chars() .next_back()