Skip to content

Commit ee564d5

Browse files
committed
Merge pull request #85 from talchas/master
Cache (regexp-opt rust-special-types 'symbols) in rust-is-lt-char-operator
2 parents c0e3878 + c49bb12 commit ee564d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rust-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@
378378
;; newer Emacs versions, but will work on Emacs 23.)
379379
(defun regexp-opt-symbols (words)
380380
(concat "\\_<" (regexp-opt words t) "\\_>"))
381+
(defconst rust-re-special-types (regexp-opt-symbols rust-special-types))
381382

382383
(defvar rust-mode-font-lock-keywords
383384
(append
@@ -851,7 +852,7 @@
851852
(or
852853
;; The special types can't take type param lists, so a < after one is
853854
;; always an operator
854-
(looking-at (regexp-opt rust-special-types 'symbols))
855+
(looking-at rust-re-special-types)
855856

856857
(rust-is-in-expression-context 'ident)))
857858

0 commit comments

Comments
 (0)