branch: elpa/rust-mode
commit 0914b48b082c326160fbce2e6d47a468514323cf
Merge: 3517321 f8d94cb
Author: Micah Chalmer <[email protected]>
Commit: Micah Chalmer <[email protected]>
Merge pull request #133 from kraai/avoid-cl
Use catch and throw instead of block and return
---
rust-mode.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust-mode.el b/rust-mode.el
index 56657d6..8590da2 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -14,7 +14,6 @@
;;; Code:
(eval-when-compile (require 'rx)
- (require 'cl)
(require 'compile)
(require 'url-vars))
@@ -541,17 +540,18 @@ function or trait. When nil, where will be aligned with
fn or trait."
"Matches names like \"foo::\" or \"Foo::\" (depending on RE-IDENT, which
should match
the desired identifiers), but does not match type annotations \"foo::<\"."
`(lambda (limit)
- (block nil
+ (catch 'rust-path-font-lock-matcher
(while t
(let* ((symbol-then-colons (rx-to-string '(seq (group (regexp
,re-ident)) "::")))
(match (re-search-forward symbol-then-colons limit t)))
(cond
;; If we didn't find a match, there are no more occurrences
;; of foo::, so return.
- ((null match) (return nil))
+ ((null match) (throw 'rust-path-font-lock-matcher nil))
;; If this isn't a type annotation foo::<, we've found a
;; match, so a return it!
- ((not (looking-at (rx (0+ space) "<"))) (return match))))))))
+ ((not (looking-at (rx (0+ space) "<")))
+ (throw 'rust-path-font-lock-matcher match))))))))
(defvar rust-mode-font-lock-keywords
(append