Skip to content

Commit 1ce4f8e

Browse files
committed
rust--format-call: Delete file in case of error
That was always the intention, but the cleanup code was always placed outside the unwind forms. lib/rust-mode/rust-rustfmt.el:60:12: Warning: ‘unwind-protect’ without unwind forms
1 parent 87bf4ea commit 1ce4f8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: rust-rustfmt.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
(insert-file-contents tmpf)
8888
(rust--format-fix-rustfmt-buffer (buffer-name buf))
8989
(error "Rustfmt failed, see %s buffer for details"
90-
rust-rustfmt-buffername))))
91-
(delete-file tmpf))))))
90+
rust-rustfmt-buffername)))
91+
(delete-file tmpf)))))))
9292

9393
;; Since we run rustfmt through stdin we get <stdin> markers in the
9494
;; output. This replaces them with the buffer name instead.

0 commit comments

Comments
 (0)