Skip to content

Commit 9384726

Browse files
committed
fix(cli): Do not overwrite when no changes were made
1 parent d1b4d9a commit 9384726

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)