Skip to content

Commit

Permalink
path logging
Browse files Browse the repository at this point in the history
  • Loading branch information
KG32 committed May 14, 2024
1 parent e74fe5f commit 8fe73fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -56,7 +58,6 @@ impl Stats {
}

fn from_file(&mut self, path: &str) -> Result<(), Box<dyn Error>> {
// 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)?;
Expand All @@ -66,8 +67,6 @@ impl Stats {
}

fn from_dir(&mut self, path: &str) -> Result<Vec<PathBuf>, Box<dyn Error>> {
// println!("\nDirectory: {}", path);

let paths = Self::traverse_for_uddf(path)?;
for path in &paths {
self.from_file(&path.to_str().unwrap());
Expand Down

0 comments on commit 8fe73fb

Please sign in to comment.