From d9589e260dbf97992cdd7407f824d3d7c6e9fbd4 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 6 Aug 2023 11:21:16 +0100 Subject: [PATCH] remove extra logging --- src/file/env.rs | 4 ---- src/history/add.rs | 6 ------ src/test_utils.rs | 2 -- 3 files changed, 12 deletions(-) diff --git a/src/file/env.rs b/src/file/env.rs index e0d2a2b..1718b75 100644 --- a/src/file/env.rs +++ b/src/file/env.rs @@ -18,14 +18,11 @@ impl FileEnv { Self { open: Box::new(move |file_name| { let path = format!("{}/{}", &open_dir, file_name); - println!("opening {}", path); let file = File::open(&path)?; - println!("opened {}", path); Ok(file) }), append_line: Box::new(move |file_name, line| { let path = format!("{}/{}", &append_dir, file_name); - println!("appending to {}", path); let mut file = OpenOptions::new() .write(true) .append(true) @@ -33,7 +30,6 @@ impl FileEnv { .open(&path) .unwrap(); writeln!(file, "{}", line)?; - println!("appended to {}", path); Ok(()) }), } diff --git a/src/history/add.rs b/src/history/add.rs index 45a13b1..492916b 100644 --- a/src/history/add.rs +++ b/src/history/add.rs @@ -4,7 +4,6 @@ use crate::prelude::*; use super::Link; pub fn add(link: &Link, file_name: &str, e: &FileEnv) -> Result<()> { - println!("history::append::to {}", file_name); (e.append_line)(file_name, &link.href)?; Ok(()) } @@ -25,7 +24,6 @@ mod tests { let file_name = "download.txt"; let dir = create_text_file(file_name, include_bytes!("../../test/data/empty.txt"))?; let path = format!("{}/{}", dir.path().to_string_lossy(), file_name); - println!("removing file {}", path); std::fs::remove_file(path)?; let link = Link { @@ -37,18 +35,14 @@ mod tests { length: None, }; //when - println!("about to add"); add( &link, file_name, &FileEnv::create(dir.path().to_string_lossy().to_string()), )?; - println!("called add"); //then - println!("about to read file contents"); let content: Vec = read_text_file(dir.path(), file_name)?; - println!("read file contents"); drop(dir); let expected = vec!["foo".to_string()]; diff --git a/src/test_utils.rs b/src/test_utils.rs index 13569fd..a29fcfa 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -27,7 +27,6 @@ pub fn create_text_file(name: &str, data: &[u8]) -> Result { pub fn read_text_file(path: &Path, file_name: &str) -> Result> { let file_name = format!("{}/{}", path.to_str().unwrap(), file_name); - println!("test_utils::read_text_file: {}", file_name); Ok(read_to_string(file_name)? .lines() .map(String::from) @@ -64,7 +63,6 @@ pub fn mock_network_fetch_as_bytes_with_rss_entries( pub fn mock_file_open(real_paths: HashMap) -> FileOpenFn { Box::new(move |path: &str| { if let Some(real_path) = real_paths.get(&path.to_string()) { - println!("opening {}", real_path); Ok(File::open(real_path)?) } else { Err(Error::message(