branch: elpa/rust-mode
commit f8d94cb53cdfc22cf715edd16cf0f0f8fadffbf3
Author: Matt Kraai <[email protected]>
Commit: Matt Kraai <[email protected]>
Use catch and throw instead of block and return
Fixes #130
---
rust-mode.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust-mode.el b/rust-mode.el
index 56b356d..fdde64f 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