File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1200,7 +1200,10 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1200
1200
t `(t , tmpf ) nil )))
1201
1201
(cond
1202
1202
((zerop ret)
1203
- (error " Rustfmt failed, see *rustfmt* buffer for details " ))
1203
+ (if (not (string= (buffer-string )
1204
+ (with-current-buffer buf (buffer-string ))))
1205
+ (copy-to-buffer buf (point-min ) (point-max )))
1206
+ (kill-buffer ))
1204
1207
((= ret 3 )
1205
1208
(if (not (string= (buffer-string )
1206
1209
(with-current-buffer buf (buffer-string ))))
@@ -1209,10 +1212,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1209
1212
(insert-file-contents tmpf)
1210
1213
(error " Rustfmt could not format some lines, see *rustfmt* buffer for details " ))
1211
1214
(t
1212
- (if (not (string= (buffer-string )
1213
- (with-current-buffer buf (buffer-string ))))
1214
- (copy-to-buffer buf (point-min ) (point-max )))
1215
- (kill-buffer )))))))
1215
+ (error " Rustfmt failed, see *rustfmt* buffer for details " )))))))
1216
1216
1217
1217
(defconst rust--format-word " \\ b\\ (else\\ |enum\\ |fn\\ |for\\ |if\\ |let\\ |loop\\ |match\\ |struct\\ |unsafe\\ |while\\ )\\ b" )
1218
1218
(defconst rust--format-line " \\ ([\n ]\\ )" )
You can’t perform that action at this time.
0 commit comments