Skip to content

Commit

Permalink
refactor html report creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Adinata Wijaya committed Jul 27, 2023
1 parent 649e178 commit 989b7e7
Show file tree
Hide file tree
Showing 2 changed files with 299 additions and 207 deletions.
12 changes: 3 additions & 9 deletions src/csv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ pub enum Error {
#[error("Failed to compile regex {0}")]
/// Regex compilation failed
RegexCompilationFailed(#[from] regex::Error),
#[error("Problem creating csv report {0}")]
/// Reporting could not be created
ReportingFailed(#[from] report::Error),
#[error("File access failed {0}")]
/// File access failed
FileAccessFailed(#[from] FatIOError),
Expand Down Expand Up @@ -518,12 +515,9 @@ pub(crate) fn compare_paths(
error!("{}", &error);
});
let is_error = !results.is_empty();
let result = report::Difference {
nominal_file: nominal.as_ref().to_path_buf(),
actual_file: actual.as_ref().to_path_buf(),
is_error,
detail: results.into_iter().map(report::DiffDetail::CSV).collect(),
};
let mut result = report::Difference::new_for_file(nominal.as_ref(), actual.as_ref());
result.is_error = is_error;
result.detail = results.into_iter().map(report::DiffDetail::CSV).collect();
Ok(result)
}

Expand Down
Loading

0 comments on commit 989b7e7

Please sign in to comment.