summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorNathan Moreau <nathan.moreau@m4x.org>2020-03-22 18:49:28 +0100
committerGitHub <noreply@github.com>2020-03-22 18:49:28 +0100
commit2df6cf72163db57fd0c79fefd0e79f38f29f7d93 (patch)
treed2b4e68bfd2bbc45757617483eb33eea3468ee32 /rust-mode.el
parent6f1abc33d6d03661d6edd165a440c6df874e5912 (diff)
downloadrust-mode-2df6cf72163db57fd0c79fefd0e79f38f29f7d93.tar.gz
Don't fail on re-search-forward. (#359)
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 59d6675..e7ef1ef 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1483,7 +1483,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
(defun rust--format-fix-rustfmt-buffer (buffer-name)
(with-current-buffer (get-buffer rust-rustfmt-buffername)
(goto-char (point-min))
- (while (re-search-forward "--> <stdin>:")
+ (while (re-search-forward "--> <stdin>:" nil t)
(replace-match (format "--> %s:" buffer-name)))))
;; If rust-mode has been configured to navigate to source of the error
@@ -1514,7 +1514,7 @@ rustfmt complain in the echo area."
(let ((target-buffer (with-current-buffer rustfmt
(save-excursion
(goto-char (point-min))
- (when (re-search-forward "--> \\([^:]+\\):")
+ (when (re-search-forward "--> \\([^:]+\\):" nil t)
(match-string 1)))))
(target-point (with-current-buffer rustfmt
;; No save-excursion, this is how we cycle through!