File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1195,12 +1195,13 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1195
1195
(with-current-buffer (get-buffer-create " *rustfmt*" )
1196
1196
(erase-buffer )
1197
1197
(insert-buffer-substring buf)
1198
- (if (zerop (call-process-region (point-min ) (point-max ) rust-rustfmt-bin t t nil ))
1199
- (progn
1200
- (if (not (string= (buffer-string ) (with-current-buffer buf (buffer-string ))))
1201
- (copy-to-buffer buf (point-min ) (point-max )))
1202
- (kill-buffer ))
1203
- (error " Rustfmt failed, see *rustfmt* buffer for details " ))))
1198
+ (let ((ret (call-process-region (point-min ) (point-max ) rust-rustfmt-bin t '(t nil ) nil )))
1199
+ (if (or (zerop ret) (= ret 3 ))
1200
+ (progn
1201
+ (if (not (string= (buffer-string ) (with-current-buffer buf (buffer-string ))))
1202
+ (copy-to-buffer buf (point-min ) (point-max )))
1203
+ (kill-buffer ))
1204
+ (error " Rustfmt failed, see *rustfmt* buffer for details " )))))
1204
1205
1205
1206
(defconst rust--format-word " \\ b\\ (else\\ |enum\\ |fn\\ |for\\ |if\\ |let\\ |loop\\ |match\\ |struct\\ |unsafe\\ |while\\ )\\ b" )
1206
1207
(defconst rust--format-line " \\ ([\n ]\\ )" )
You can’t perform that action at this time.
0 commit comments