Skip to content

Commit 5c68caf

Browse files
authored
Merge pull request #175 from mrBliss/imenu-unsafe
Recognize imenu items starting with "unsafe"
2 parents 8f1297a + cc59c83 commit 5c68caf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rust-mode.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
(defconst rust-re-lc-ident "[[:lower:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*")
3333
(defconst rust-re-uc-ident "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*")
3434
(defconst rust-re-vis "pub")
35+
(defconst rust-re-unsafe "unsafe")
3536

3637
(defconst rust-re-non-standard-string
3738
(rx
@@ -569,6 +570,7 @@ buffer."
569570
(defun rust-re-item-def-imenu (itype)
570571
(concat "^[[:space:]]*"
571572
(rust-re-shy (concat (rust-re-word rust-re-vis) "[[:space:]]+")) "?"
573+
(rust-re-shy (concat (rust-re-word rust-re-unsafe) "[[:space:]]+")) "?"
572574
(rust-re-item-def itype)))
573575

574576
(defconst rust-re-special-types (regexp-opt rust-special-types 'symbols))

0 commit comments

Comments
 (0)