emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode f80a0ce35b 1/5: Do not prettify && when it is a


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode f80a0ce35b 1/5: Do not prettify && when it is a double reference
Date: Tue, 28 Dec 2021 07:58:27 -0500 (EST)

branch: elpa/rust-mode
commit f80a0ce35b5b4d179b043d01ec7a55dcaf04f8ab
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    Do not prettify && when it is a double reference
---
 rust-mode.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/rust-mode.el b/rust-mode.el
index eec6057fb0..6f8a214fd3 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -222,12 +222,14 @@ Use idomenu (imenu with `ido-mode') for best mileage.")
 See `prettify-symbols-compose-predicate'."
   (and (fboundp 'prettify-symbols-default-compose-p)
        (prettify-symbols-default-compose-p start end match)
-       ;; Make sure there is a space before || as it is also used for
-       ;; functions with 0 arguments.
-       (not (and (string= match "||")
-                 (save-excursion
-                   (goto-char start)
-                   (looking-back "\\(?:\\<move\\|=\\) *"))))))
+       ;; Make sure || is not a closure with 0 arguments and && is not
+       ;; a double reference.
+       (pcase match
+         ("||" (not (save-excursion
+                      (goto-char start)
+                      (looking-back "\\(?:\\<move\\|=\\) *"))))
+         ("&&" (char-equal (char-after end) ?\s))
+         (_ t))))
 
 ;;; Mode
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]