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

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

[nongnu] elpa/rust-mode 2f58eee672 2/3: Fix warnings from rust-utils.el


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 2f58eee672 2/3: Fix warnings from rust-utils.el
Date: Sat, 24 Feb 2024 10:01:24 -0500 (EST)

branch: elpa/rust-mode
commit 2f58eee672ac467d333cf336a38cda859e4fcfd2
Author: Sibi Prabakaran <sibi@psibi.in>
Commit: Sibi Prabakaran <sibi@psibi.in>

    Fix warnings from rust-utils.el
---
 rust-utils.el | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/rust-utils.el b/rust-utils.el
index cb55172b72..d93bd0a07f 100644
--- a/rust-utils.el
+++ b/rust-utils.el
@@ -41,22 +41,22 @@ visit the new file."
 if not. Move cursor to the end of macro."
   (when (rust-in-str)
     (up-list -1 t t))
-  (setq safe-to-forward t)
-  (save-excursion
-    (condition-case nil
-        (forward-sexp)
-      (error (setq safe-to-forward nil)
-             nil)))
-  (cond
-   ((not safe-to-forward)
-    (rust-insert-dbg-alone))
-   (t
-    (insert "(")
-    (forward-sexp)
-    (insert ")")
-    (backward-sexp)
-    (insert "dbg!")
-    (forward-sexp))))
+  (let ((safe-to-forward t))
+    (save-excursion
+      (condition-case nil
+          (forward-sexp)
+        (error (setq safe-to-forward nil)
+               nil)))
+    (cond
+     ((not safe-to-forward)
+      (rust-insert-dbg-alone))
+     (t
+      (insert "(")
+      (forward-sexp)
+      (insert ")")
+      (backward-sexp)
+      (insert "dbg!")
+      (forward-sexp)))))
 
 (defun rust-insert-dbg-region ()
   "Insert the dbg! macro around a region. Move cursor to the end of macro."
@@ -77,9 +77,9 @@ if not. Move cursor to the end of macro."
 (defun rust-dbg-wrap-or-unwrap ()
   "Either remove or add the dbg! macro."
   (interactive)
-  
+
   (cond
-   
+
    ;; region
    ((region-active-p)
     (rust-insert-dbg-region))
@@ -106,7 +106,7 @@ if not. Move cursor to the end of macro."
              (delete-pair))
             (t (rust-insert-dbg-sexp)))))
    )
-)
+  )
 
 (defun rust-toggle-mutability ()
   "Toggles the mutability of the variable defined on the current line"



reply via email to

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