collect the mtime *after* formatting.

Fixes #118
This commit is contained in:
zimbatm 2021-08-14 17:03:47 +02:00
parent f212b0ab7e
commit 948196ade5
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7
2 changed files with 4 additions and 2 deletions

View File

@ -38,6 +38,7 @@ quite tricky.
## Usage
`$ treefmt --help`
```
treefmt 0.2.3
✨ format all your language!

View File

@ -189,6 +189,9 @@ pub fn run_treefmt(
} else {
let start_time = Instant::now();
// Run the formatter
formatter.clone().fmt(&paths)?;
// Get the new mtimes and compare them to the original ones
let new_paths = paths
.clone()
@ -200,8 +203,6 @@ pub fn run_treefmt(
sum
});
formatter.clone().fmt(&paths)?;
info!(
"{}: {} files processed in {:.2?}",
formatter.name,