Skip to content

Commit 948196a

Browse files
committed
collect the mtime *after* formatting.
Fixes #118
1 parent f212b0a commit 948196a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ quite tricky.
3838
## Usage
3939

4040
`$ treefmt --help`
41+
4142
```
4243
treefmt 0.2.3
4344
✨ format all your language!

src/engine.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ pub fn run_treefmt(
189189
} else {
190190
let start_time = Instant::now();
191191

192+
// Run the formatter
193+
formatter.clone().fmt(&paths)?;
194+
192195
// Get the new mtimes and compare them to the original ones
193196
let new_paths = paths
194197
.clone()
@@ -200,8 +203,6 @@ pub fn run_treefmt(
200203
sum
201204
});
202205

203-
formatter.clone().fmt(&paths)?;
204-
205206
info!(
206207
"{}: {} files processed in {:.2?}",
207208
formatter.name,

0 commit comments

Comments
 (0)