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

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

[nongnu] elpa/swift-mode c882c70 053/496: Replace `if` exprs with `when`


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode c882c70 053/496: Replace `if` exprs with `when` exprs
Date: Sun, 29 Aug 2021 11:33:06 -0400 (EDT)

branch: elpa/swift-mode
commit c882c70a70122b262553d6010c6e2820a1d02b6d
Author: Chris Barrett <chris.d.barrett@me.com>
Commit: Chris Barrett <chris.d.barrett@me.com>

    Replace `if` exprs with `when` exprs
    
    Fix degenerate `if` expressions with no else clause. Use with `when`
    expressions instead.
---
 swift-mode.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/swift-mode.el b/swift-mode.el
index a538b7c..c879eb7 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -72,11 +72,12 @@
   "Move backward past spaces and comments."
   (let ((starting (point)))
     (skip-chars-backward "[:space:]\n")
-    (if (looking-back "\\*/") (backward-char))
-    (if (swift-indent--in-str-or-cmnt)
-        (swift-indent--rewind-past-str-cmnt))
-    (if (/= starting (point))
-        (swift-indent--rewind-irrelevant))))
+    (when (looking-back "\\*/")
+      (backward-char))
+    (when (swift-indent--in-str-or-cmnt)
+      (swift-indent--rewind-past-str-cmnt))
+    (when (/= starting (point))
+      (swift-indent--rewind-irrelevant))))
 
 (defun swift-indent--align-to-expr-after-brace ()
   "Return the column to use for aligning an expression after a brace."



reply via email to

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