Skip to content

Commit f2f4d67

Browse files
committed
Merge pull request #59 from lunaryorn/fix-byte-compiler-warnings
Fix some byte compiler warnings on Emacs 25.1
2 parents 1be7a94 + 96f7f79 commit f2f4d67

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

rust-mode.el

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
(defun rust-rewind-irrelevant ()
7878
(let ((starting (point)))
7979
(skip-chars-backward "[:space:]\n")
80-
(if (looking-back "\\*/") (backward-char))
80+
(if (looking-back "\\*/" nil) (backward-char))
8181
(if (rust-in-str-or-cmnt)
8282
(rust-rewind-past-str-cmnt))
8383
(if (/= starting (point))
@@ -104,6 +104,8 @@
104104
(backward-up-list)
105105
(back-to-indentation))))
106106

107+
(defconst rust-re-ident "[[:word:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*")
108+
107109
(defun rust-align-to-method-chain ()
108110
(save-excursion
109111
;; for method-chain alignment to apply, we must be looking at
@@ -139,13 +141,13 @@
139141
;;
140142
((skip-dot-identifier
141143
(lambda ()
142-
(when (looking-back (concat "\\." rust-re-ident))
144+
(when (looking-back (concat "\\." rust-re-ident) nil)
143145
(forward-thing 'symbol -1)
144146
(backward-char)
145147
(- (current-column) rust-indent-offset)))))
146148
(cond
147149
;; foo.bar(...)
148-
((looking-back ")")
150+
((looking-back ")" nil)
149151
(backward-list 1)
150152
(funcall skip-dot-identifier))
151153

@@ -269,7 +271,7 @@
269271
;; ..or if the previous line ends with any of these:
270272
;; { ? : ( , ; [ }
271273
;; then we are at the beginning of an expression, so stay on the baseline...
272-
(looking-back "[(,:;?[{}]\\|[^|]|")
274+
(looking-back "[(,:;?[{}]\\|[^|]|" nil)
273275
;; or if the previous line is the end of an attribute, stay at the baseline...
274276
(progn (rust-rewind-to-beginning-of-current-level-expr) (looking-at "#")))))
275277
baseline
@@ -318,7 +320,6 @@
318320
"bool"
319321
"str" "char"))
320322

321-
(defconst rust-re-ident "[[:word:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*")
322323
(defconst rust-re-CamelCase "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*")
323324
(defun rust-re-word (inner) (concat "\\<" inner "\\>"))
324325
(defun rust-re-grab (inner) (concat "\\(" inner "\\)"))
@@ -666,7 +667,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
666667
"If the most recently inserted character is a `>`, briefly moves point to matching `<` (if any)."
667668
(interactive)
668669
(when (and rust-blink-matching-angle-brackets
669-
(looking-back ">"))
670+
(looking-back ">" nil))
670671
(let ((matching-angle-bracket-point (save-excursion
671672
(backward-char 1)
672673
(rust-find-matching-angle-bracket))))

0 commit comments

Comments
 (0)