chore: contains_key needs a Box<str>
, so generify is_dir
to accept one
This commit is contained in:
parent
b7ac989013
commit
d78f127039
2 changed files with 2 additions and 1 deletions
|
@ -703,6 +703,7 @@ impl<R: Read + Seek> ZipArchive<R> {
|
||||||
"Invalid UTF-8 as symlink target",
|
"Invalid UTF-8 as symlink target",
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
let target = target.into_boxed_str();
|
||||||
let target_is_dir_from_archive =
|
let target_is_dir_from_archive =
|
||||||
self.shared.files.contains_key(&target) && is_dir(&target);
|
self.shared.files.contains_key(&target) && is_dir(&target);
|
||||||
let target_internal_path: PathBuf = target.into();
|
let target_internal_path: PathBuf = target.into();
|
||||||
|
|
|
@ -227,7 +227,7 @@ impl Zip64CentralDirectoryEnd {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn is_dir(filename: &str) -> bool {
|
pub(crate) fn is_dir<T: AsRef<str>>(filename: T) -> bool {
|
||||||
filename
|
filename
|
||||||
.chars()
|
.chars()
|
||||||
.next_back()
|
.next_back()
|
||||||
|
|
Loading…
Add table
Reference in a new issue