Skip to content

Commit

Permalink
Only write file if it has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
WGUNDERWOOD committed Aug 28, 2024
1 parent c6b6a9c commit 2a3554f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions extra/perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ echo
# tex-fmt
TEXFMTFILE="hyperfine-tex-fmt.csv"
hyperfine --warmup 10 \
--min-runs 50 \
--export-csv $TEXFMTFILE \
--command-name "tex-fmt" \
--prepare "cp -r ../tests/* $DIR" \
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn main() {
"File is not correctly formatted.".to_string(),
);
exit_code = 1;
} else {
} else if text != new_text {
write_file(file, &new_text);
}
} else {
Expand Down

0 comments on commit 2a3554f

Please sign in to comment.