Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 46 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ serde_yml = "0.0.13"
similar = "3"
tempfile = "3.27"
socket2 = "0.6"
zip = "8"
zip = "9"
# bincode 3.0.0 intentionally compile_error!s; retain the existing index format (#342).
bincode = "=1.3.3"

Expand Down
9 changes: 7 additions & 2 deletions src/reference/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ pub fn extract_zip_to(archive_bytes: &[u8], dest: &Path) -> Result<()> {
let mut file = archive
.by_index(i)
.with_context(|| format!("failed to read zip entry {i}"))?;
let raw_name = file.name().to_string();
let raw_name = file
.name()
.with_context(|| format!("failed to read name of zip entry {i}"))?
.into_owned();
let stripped = match strip_prefix(&raw_name, &prefix) {
Some(s) if !s.is_empty() => s.to_string(),
_ => continue,
Expand Down Expand Up @@ -317,7 +320,9 @@ fn detect_top_level_prefix(archive: &mut zip::ZipArchive<Cursor<&[u8]>>) -> Resu
return Err(anyhow!("zip archive is empty"));
}
let first = archive.by_index(0).context("zip archive has no entries")?;
let name = first.name();
let name = first
.name()
.context("failed to read name of first zip entry")?;
if let Some(idx) = name.find('/') {
Ok(name[..=idx].to_string())
} else {
Expand Down
Loading