Skip to content

Commit 2df6cf7

Browse files
authored
Don't fail on re-search-forward. (#359)
1 parent 6f1abc3 commit 2df6cf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust-mode.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
14831483
(defun rust--format-fix-rustfmt-buffer (buffer-name)
14841484
(with-current-buffer (get-buffer rust-rustfmt-buffername)
14851485
(goto-char (point-min))
1486-
(while (re-search-forward "--> <stdin>:")
1486+
(while (re-search-forward "--> <stdin>:" nil t)
14871487
(replace-match (format "--> %s:" buffer-name)))))
14881488

14891489
;; If rust-mode has been configured to navigate to source of the error
@@ -1514,7 +1514,7 @@ rustfmt complain in the echo area."
15141514
(let ((target-buffer (with-current-buffer rustfmt
15151515
(save-excursion
15161516
(goto-char (point-min))
1517-
(when (re-search-forward "--> \\([^:]+\\):")
1517+
(when (re-search-forward "--> \\([^:]+\\):" nil t)
15181518
(match-string 1)))))
15191519
(target-point (with-current-buffer rustfmt
15201520
;; No save-excursion, this is how we cycle through!

0 commit comments

Comments
 (0)