Skip to content

Commit

Permalink
feat: run the same formatter in parallel for many files (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil authored Apr 19, 2024
1 parent 4f5a8f0 commit 4dd19e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ pub fn run_treefmt(
let start_time = Instant::now();

// Run the formatter
for path_chunks in paths.chunks(1024) {
formatter.clone().fmt(path_chunks)?;
}
paths.par_chunks(1024).try_for_each(|path_chunks| {
formatter.clone().fmt(path_chunks)
})?;

// Get the new mtimes and compare them to the original ones
let new_paths = paths
Expand Down

0 comments on commit 4dd19e6

Please sign in to comment.