We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b3b0f78 + cffb950 commit ba5ff90Copy full SHA for ba5ff90
rust-mode.el
@@ -1258,8 +1258,10 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1258
(erase-buffer)
1259
(insert-buffer-substring buf)
1260
(if (zerop (call-process-region (point-min) (point-max) rust-rustfmt-bin t t nil))
1261
- (progn (copy-to-buffer buf (point-min) (point-max))
1262
- (kill-buffer))
+ (progn
+ (if (not (string= (buffer-string) (with-current-buffer buf (buffer-string))))
1263
+ (copy-to-buffer buf (point-min) (point-max)))
1264
+ (kill-buffer))
1265
(error "Rustfmt failed, see *rustfmt* buffer for details"))))
1266
1267
(defun rust-format-buffer ()
0 commit comments