diff --git a/src/parser.rs b/src/parser.rs index 38ae372..903a00b 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -39,16 +39,8 @@ pub fn process_files( pub fn read_lines( file_path: &Path, ) -> anyhow::Result>, anyhow::Error> { - match file_path.try_exists() { - Ok(true) => {} - Ok(false) => return Err(anyhow::anyhow!("File path needs to exist")), - Err(e) => eprintln!("Error checking path: {e}"), - } - - let path_string = file_path.to_string_lossy().to_string(); - - let file = - File::open(file_path).with_context(|| format!("failed to open file: {path_string}"))?; + let file = File::open(file_path) + .with_context(|| format!("failed to open file: {}", file_path.display()))?; let reader = BufReader::new(file); Ok(reader.lines())