From 5643ea3ee1b23587e4d34913b7c618175246b368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 7 Sep 2019 10:59:44 +0100 Subject: [PATCH] better verbosity --- src/index.rs | 1 - src/repository.rs | 7 ------- src/repository_item.rs | 2 -- tests/system_tests.rs | 2 +- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/index.rs b/src/index.rs index 15f8a43..0b7d5e2 100644 --- a/src/index.rs +++ b/src/index.rs @@ -62,7 +62,6 @@ impl Index { } pub fn remember(&mut self, item: RepositoryItem) { - println!("remembering {}", item); self.items.push(item.into()); } diff --git a/src/repository.rs b/src/repository.rs index 4e3e597..b191a4d 100644 --- a/src/repository.rs +++ b/src/repository.rs @@ -67,7 +67,6 @@ impl<'a> Repository<'a> { } if source_path.is_file() { - println!("storing {} as {}", source_path.display(), destination_path.display()); fs::create_dir_all(destination_path.parent().unwrap())?; let version = Repository::calculate_version(source_path)?; fs::copy(source_path, destination_path)?; @@ -95,12 +94,6 @@ impl<'a> Repository<'a> { } pub fn item_by_source_path(&self, path: &Path) -> Result, BakareError> { - println!( - "trying to find {} in a repo [{}] of {} items", - path.display(), - self.path.display(), - self.index.len() - ); if !path.is_absolute() { return Err(BakareError::RepositoryPathNotAbsolute); } diff --git a/src/repository_item.rs b/src/repository_item.rs index efccac4..60e2a77 100644 --- a/src/repository_item.rs +++ b/src/repository_item.rs @@ -32,13 +32,11 @@ impl RepositoryItem { } let parent = target_path.parent().unwrap(); if !parent.exists() { - println!("Creating {}", parent.display()); fs::create_dir_all(parent)?; } if !self.absolute_path.exists() { return Err(BakareError::CorruptedRepoNoFile); } - println!("Saving {} to {}", self.absolute_path.display(), target_path.display()); fs::copy(&self.absolute_path, &target_path)?; Ok(()) diff --git a/tests/system_tests.rs b/tests/system_tests.rs index 7e8b770..37dd10b 100644 --- a/tests/system_tests.rs +++ b/tests/system_tests.rs @@ -137,7 +137,7 @@ fn assert_directory_trees_have_same_contents(left: &Path, right: &Path) -> Resul let mut br = vec![]; fl.read_to_end(&mut bl)?; fr.read_to_end(&mut br)?; - assert_eq!(bl, bl); + assert_eq!(bl, br); } Ok(()) }