Have the caller track stats here.

This commit is contained in:
Patrick Thomson 2020-09-29 15:43:30 -04:00
parent 9f9f2a52b7
commit 16bd061b33
2 changed files with 15 additions and 11 deletions

View file

@ -16,8 +16,8 @@ pub struct Edit {
#[derive(Debug, Default)]
pub struct Stats {
successful_parses : usize,
total_parses : usize,
pub successful_parses : usize,
pub total_parses : usize,
}
impl fmt::Display for Stats {
@ -41,7 +41,6 @@ pub fn parse_file_at_path(
debug: bool,
debug_graph: bool,
allow_cancellation: bool,
stats: &mut Stats,
) -> Result<bool> {
let mut _log_session = None;
let mut parser = Parser::new();
@ -178,11 +177,6 @@ pub fn parse_file_at_path(
}
}
stats.total_parses += 1;
if first_error.is_none() {
stats.successful_parses += 1;
}
if first_error.is_some() || print_time {
write!(
&mut stdout,