Skip to content

Commit

Permalink
rust--format-call: Delete file in case of error
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tarsius committed Mar 16, 2024
1 parent 87bf4ea commit 1ce4f8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust-rustfmt.el
Expand Up @@ -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 <stdin> markers in the
;; output. This replaces them with the buffer name instead.
Expand Down

0 comments on commit 1ce4f8e

Please sign in to comment.