From 8fe73fb5b450206583413edf13e1d8ed1fedba85 Mon Sep 17 00:00:00 2001 From: Kuba Groblewski Date: Tue, 14 May 2024 21:27:55 +0200 Subject: [PATCH] path logging --- src/stats.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stats.rs b/src/stats.rs index 9dec73e..221eb08 100644 --- a/src/stats.rs +++ b/src/stats.rs @@ -45,8 +45,10 @@ impl Stats { let mut stats = Self::new(); let path_meta = fs::metadata(path)?; if path_meta.is_file() { + println!("File: {}", path); stats.from_file(path)?; } else if path_meta.is_dir() { + println!("Directory: {}", path); stats.from_dir(path)?; } else { return Err("Unable to resolve file or directory".into()) @@ -56,7 +58,6 @@ impl Stats { } fn from_file(&mut self, path: &str) -> Result<(), Box> { - // println!("\nFile: {}", path); let UDDFData { dives_data, gas_mixes } = self.extract_data_from_file(path)?; for dive_data in dives_data { let dive = self.calc_dive_stats(&dive_data, &gas_mixes)?; @@ -66,8 +67,6 @@ impl Stats { } fn from_dir(&mut self, path: &str) -> Result, Box> { - // println!("\nDirectory: {}", path); - let paths = Self::traverse_for_uddf(path)?; for path in &paths { self.from_file(&path.to_str().unwrap());