From 1ce4f8e26606462d73dc0895983d733580469124 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sat, 16 Mar 2024 23:05:05 +0100 Subject: [PATCH] rust--format-call: Delete file in case of error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- rust-rustfmt.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-rustfmt.el b/rust-rustfmt.el index f609980..cab183c 100644 --- a/rust-rustfmt.el +++ b/rust-rustfmt.el @@ -87,8 +87,8 @@ (insert-file-contents tmpf) (rust--format-fix-rustfmt-buffer (buffer-name buf)) (error "Rustfmt failed, see %s buffer for details" - rust-rustfmt-buffername)))) - (delete-file tmpf)))))) + rust-rustfmt-buffername))) + (delete-file tmpf))))))) ;; Since we run rustfmt through stdin we get markers in the ;; output. This replaces them with the buffer name instead.