From efcac39d34580f6928ddebbb2819754293ae3393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 30 Nov 2020 16:22:19 +0100 Subject: [PATCH] gc: remove duplicate variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit list_images already returns absolute paths, we don't need to prepend anything. Signed-off-by: Fabian Grünbichler --- src/backup/datastore.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/backup/datastore.rs b/src/backup/datastore.rs index 2700d6e9..8ea0a753 100644 --- a/src/backup/datastore.rs +++ b/src/backup/datastore.rs @@ -491,26 +491,24 @@ impl DataStore { } } - let path = self.chunk_store.relative_path(&img); - - match std::fs::File::open(&path) { + match std::fs::File::open(&img) { Ok(file) => { if let Ok(archive_type) = archive_type(&img) { if archive_type == ArchiveType::FixedIndex { let index = FixedIndexReader::new(file).map_err(|e| { - format_err!("can't read index '{}' - {}", path.to_string_lossy(), e) + format_err!("can't read index '{}' - {}", img.to_string_lossy(), e) })?; self.index_mark_used_chunks(index, &img, status, worker)?; } else if archive_type == ArchiveType::DynamicIndex { let index = DynamicIndexReader::new(file).map_err(|e| { - format_err!("can't read index '{}' - {}", path.to_string_lossy(), e) + format_err!("can't read index '{}' - {}", img.to_string_lossy(), e) })?; self.index_mark_used_chunks(index, &img, status, worker)?; } } } Err(err) if err.kind() == io::ErrorKind::NotFound => (), // ignore vanished files - Err(err) => bail!("can't open index {} - {}", path.to_string_lossy(), err), + Err(err) => bail!("can't open index {} - {}", img.to_string_lossy(), err), } done += 1;