~cyplo/bakare

1d29b33f90bac8d032e85662a22a6b26857e8370 — Cyryl Płotnicki 3 months ago 259bcda master
more consistent logging
3 files changed, 3 insertions(+), 2 deletions(-)

M src/repository/item.rs
M src/test/assertions.rs
M src/test/source.rs
M src/repository/item.rs => src/repository/item.rs +2 -0
@@ 43,6 43,7 @@ impl RepositoryItem {
        let original_source_path = Path::new(self.original_source_path());
        let source_path_relative = original_source_path.strip_prefix("/")?;
        let source_path_relative = source_path_relative.to_string_lossy();

        let target_path = save_to.join(&source_path_relative)?;
        let parent = target_path
            .parent()


@@ 54,6 55,7 @@ impl RepositoryItem {
        }
        self.absolute_path.copy_file(&target_path)?;

        log::debug!("[{}] saved data to {}", getpid(), target_path.as_str());
        Ok(())
    }


M src/test/assertions.rs => src/test/assertions.rs +1 -1
@@ 172,7 172,7 @@ pub mod in_memory {

    fn assert_target_file_contents(restored_path: &VfsPath, expected_contents: &[u8]) -> Result<()> {
        let mut actual_contents = vec![];
        assert!(restored_path.exists(), "Expected '{:?}' to be there", restored_path);
        assert!(restored_path.exists(), "expected '{}' to be there", restored_path.as_str());
        restored_path.open_file()?.read_to_end(&mut actual_contents)?;
        assert_eq!(expected_contents, actual_contents);
        Ok(())

M src/test/source.rs => src/test/source.rs +0 -1
@@ 20,7 20,6 @@ impl TestSource {
        let path = self.file_path(filename)?;
        let mut file = path.create_file()?;
        file.write_all(bytes)?;
        dbg!(format!("wrote bytes under {}", filename));
        Ok(())
    }