Skip to content

Commit

Permalink
refactor: use cleaned_entry_path directly
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Nov 27, 2023
1 parent 672b8f0 commit c2d89d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/tarball/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ impl<'a> DownloadTarballToStore<'a> {
.write_cas_file(&buffer, file_is_executable)
.map_err(TarballError::WriteCasFile)?;

let tarball_index_key = cleaned_entry_path.clone();

if let Some(previous) = cas_paths.insert(cleaned_entry_path, file_path) {
if let Some(previous) = cas_paths.insert(cleaned_entry_path.clone(), file_path) {
tracing::warn!(?previous, "Duplication detected. Old entry has been ejected");
}

Expand All @@ -253,7 +251,7 @@ impl<'a> DownloadTarballToStore<'a> {
size: file_size,
};

if let Some(previous) = pkg_files_idx.files.insert(tarball_index_key, file_attrs) {
if let Some(previous) = pkg_files_idx.files.insert(cleaned_entry_path, file_attrs) {
tracing::warn!(?previous, "Duplication detected. Old entry has been ejected");
}
}
Expand Down

0 comments on commit c2d89d3

Please sign in to comment.