From 2a3554ff223ff1e9984af40706769850bd074387 Mon Sep 17 00:00:00 2001 From: William G Underwood <42812654+WGUNDERWOOD@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:52:28 +0100 Subject: [PATCH] Only write file if it has changed --- extra/perf.sh | 1 + src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/perf.sh b/extra/perf.sh index 2d79552..5357019 100644 --- a/extra/perf.sh +++ b/extra/perf.sh @@ -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" \ diff --git a/src/main.rs b/src/main.rs index 83369b3..df95abd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 {