Skip to content

Commit 3d15a7c

Browse files
authored
Do not write file when no changes. (#264)
Closes #263
1 parent 6365cfd commit 3d15a7c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

autocorrect-cli/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,8 @@ fn format_and_output(filepath: &str, filetype: &str, raw: &str, cli: &Cli) {
325325
progress::ok(cli);
326326
} else {
327327
progress::err(cli);
328+
fs::write(Path::new(filepath), result.out).unwrap();
328329
}
329-
330-
fs::write(Path::new(filepath), result.out).unwrap();
331330
}
332331
} else {
333332
if result.has_error() {

0 commit comments

Comments
 (0)