Skip to content

Commit

Permalink
add total rust files changed in update review report
Browse files Browse the repository at this point in the history
  • Loading branch information
nasifimtiazohi committed Jul 20, 2021
1 parent 0c72d3f commit c57ccae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions depdive/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub struct VersionChangeInfo {
#[derive(Debug, Clone)]
pub struct VersionDiffStats {
pub files_changed: u64,
pub rust_files_changed: u64,
pub insertions: u64,
pub deletions: u64,
pub modified_build_scripts: HashSet<String>, // Empty indicates no change in build scripts
Expand Down Expand Up @@ -551,6 +552,7 @@ impl UpdateAnalyzer {

Ok(VersionDiffStats {
files_changed: stats.files_changed() as u64,
rust_files_changed: files_unsafe_change_stats.len() as u64,
insertions: stats.insertions() as u64,
deletions: stats.deletions() as u64,
modified_build_scripts,
Expand Down Expand Up @@ -910,6 +912,7 @@ mod test {
Version::parse("0.9.0").unwrap()
);
assert_eq!(report.diff_stats.as_ref().unwrap().files_changed, 9);
assert_eq!(report.diff_stats.as_ref().unwrap().rust_files_changed, 4);
assert_eq!(report.diff_stats.as_ref().unwrap().insertions, 244);
assert_eq!(report.diff_stats.as_ref().unwrap().deletions, 179);
assert!(report
Expand Down Expand Up @@ -960,6 +963,7 @@ mod test {
report.updated_version.downloads
);
assert_eq!(report.diff_stats.as_ref().unwrap().files_changed, 78);
assert_eq!(report.diff_stats.as_ref().unwrap().rust_files_changed, 73);
assert_eq!(report.diff_stats.as_ref().unwrap().insertions, 1333);
assert_eq!(report.diff_stats.as_ref().unwrap().deletions, 4942);
assert_eq!(
Expand Down

0 comments on commit c57ccae

Please sign in to comment.