Skip to content

Commit 2f58eee

Browse files
committed
Fix warnings from rust-utils.el
1 parent d7c3825 commit 2f58eee

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

rust-utils.el

+19-19
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ visit the new file."
4141
if not. Move cursor to the end of macro."
4242
(when (rust-in-str)
4343
(up-list -1 t t))
44-
(setq safe-to-forward t)
45-
(save-excursion
46-
(condition-case nil
47-
(forward-sexp)
48-
(error (setq safe-to-forward nil)
49-
nil)))
50-
(cond
51-
((not safe-to-forward)
52-
(rust-insert-dbg-alone))
53-
(t
54-
(insert "(")
55-
(forward-sexp)
56-
(insert ")")
57-
(backward-sexp)
58-
(insert "dbg!")
59-
(forward-sexp))))
44+
(let ((safe-to-forward t))
45+
(save-excursion
46+
(condition-case nil
47+
(forward-sexp)
48+
(error (setq safe-to-forward nil)
49+
nil)))
50+
(cond
51+
((not safe-to-forward)
52+
(rust-insert-dbg-alone))
53+
(t
54+
(insert "(")
55+
(forward-sexp)
56+
(insert ")")
57+
(backward-sexp)
58+
(insert "dbg!")
59+
(forward-sexp)))))
6060

6161
(defun rust-insert-dbg-region ()
6262
"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."
7777
(defun rust-dbg-wrap-or-unwrap ()
7878
"Either remove or add the dbg! macro."
7979
(interactive)
80-
80+
8181
(cond
82-
82+
8383
;; region
8484
((region-active-p)
8585
(rust-insert-dbg-region))
@@ -106,7 +106,7 @@ if not. Move cursor to the end of macro."
106106
(delete-pair))
107107
(t (rust-insert-dbg-sexp)))))
108108
)
109-
)
109+
)
110110

111111
(defun rust-toggle-mutability ()
112112
"Toggles the mutability of the variable defined on the current line"

0 commit comments

Comments
 (0)