remove unnecessary clones

This commit is contained in:
alpharush 2022-12-21 15:44:44 -06:00
parent c21524ccfb
commit cedabee6b0
1 changed files with 2 additions and 3 deletions

View File

@ -690,11 +690,10 @@ impl<'a, T: ArtifactOutput> ArtifactsCacheInner<'a, T> {
/// If there is already an entry available for the file the given version is added to the set /// If there is already an entry available for the file the given version is added to the set
fn insert_new_cache_entry(&mut self, file: &Path, source: &Source, version: Version) { fn insert_new_cache_entry(&mut self, file: &Path, source: &Source, version: Version) {
if let Some((_, versions)) = self.dirty_source_files.get_mut(file) { if let Some((_, versions)) = self.dirty_source_files.get_mut(file) {
versions.insert(version.clone()); versions.insert(version);
} else { } else {
let entry = self.create_cache_entry(file, source, version.clone()); let entry = self.create_cache_entry(file, source, version.clone());
self.dirty_source_files self.dirty_source_files.insert(file.to_path_buf(), (entry, HashSet::from([version])));
.insert(file.to_path_buf(), (entry.clone(), HashSet::from([version.clone()])));
} }
} }