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

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

[nongnu] elpa/rust-mode 216faf2 353/486: Do not indent where clause by d


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 216faf2 353/486: Do not indent where clause by default (follow standard) #257
Date: Sat, 7 Aug 2021 09:25:51 -0400 (EDT)

branch: elpa/rust-mode
commit 216faf2a7372a252a7e2190c9a7474dcab71e93a
Author: Sebastien Chapuis <sebastien@chapu.is>
Commit: Sebastien Chapuis <sebastien@chapu.is>

    Do not indent where clause by default (follow standard) #257
---
 rust-mode-tests.el | 33 ++++++++++++++++++++-------------
 rust-mode.el       |  2 +-
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index b2e8338..6c6e9af 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -451,7 +451,8 @@ fn foo4(a:i32,
 "))
 
 (ert-deftest indent-body-after-where ()
-  (test-indent
+  (let ((rust-indent-where-clause t))
+    (test-indent
    "
 fn foo1(a: A, b: B) -> A
     where A: Clone + Default, B: Eq {
@@ -469,10 +470,11 @@ fn foo2(a: A, b: B) -> A
         bar: 3
     }
 }
-"))
+")))
 
 (ert-deftest indent-align-where-clauses-style1a ()
-  (test-indent
+  (let ((rust-indent-where-clause t))
+    (test-indent
    "
 fn foo1a(a: A, b: B, c: C) -> D
     where A: Clone + Default,
@@ -484,10 +486,11 @@ fn foo1a(a: A, b: B, c: C) -> D
         bar: 3
     }
 }
-"))
+")))
 
 (ert-deftest indent-align-where-clauses-style1b ()
-  (test-indent
+  (let ((rust-indent-where-clause t))
+    (test-indent
    "
 fn foo1b(a: A, b: B, c: C) -> D
     where A: Clone + Default,
@@ -500,7 +503,7 @@ fn foo1b(a: A, b: B, c: C) -> D
         bar: 3
     }
 }
-"))
+")))
 
 (ert-deftest indent-align-where-clauses-style2a ()
   (test-indent
@@ -596,7 +599,8 @@ where A: Clone + Default,
 ")))
 
 (ert-deftest indent-align-where-clauses-impl-example ()
-  (test-indent
+  (let ((rust-indent-where-clause t))
+    (test-indent
    "
 impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, V, S>
     where K: Eq + Hash + Borrow<Q>,
@@ -608,10 +612,11 @@ impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, 
V, S>
         bar: 3
     }
 }
-"))
+")))
 
 (ert-deftest indent-align-where-clauses-first-line ()
-  (test-indent
+  (let ((rust-indent-where-clause t))
+    (test-indent
    "fn foo1(a: A, b: B) -> A
     where A: Clone + Default, B: Eq {
     let body;
@@ -619,7 +624,7 @@ impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, V, 
S>
         bar: 3
     }
 }
-"))
+")))
 
 (ert-deftest indent-align-where-in-comment1 ()
   (test-indent
@@ -632,7 +637,8 @@ pub struct Region { // <-- this should be flush with left 
margin!
 "))
 
 (ert-deftest indent-align-where-in-comment2 ()
-  (test-indent
+  (let ((rust-indent-where-clause t))
+    (test-indent
    "fn foo<F,G>(f:F, g:G)
     where F:Send,
 // where
@@ -640,9 +646,10 @@ pub struct Region { // <-- this should be flush with left 
margin!
 {
     let body;
 }
-"))
+")))
 
 (ert-deftest indent-align-where-in-comment3 ()
+  (let ((rust-indent-where-clause t))
   (test-indent
    "fn foo<F,G>(f:F, g:G)
     where F:Send,
@@ -651,7 +658,7 @@ pub struct Region { // <-- this should be flush with left 
margin!
 {
     let body;
 }
-"))
+")))
 
 (ert-deftest indent-square-bracket-alignment ()
   (test-indent
diff --git a/rust-mode.el b/rust-mode.el
index 6193ebe..4fc1783 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -121,7 +121,7 @@
   :group 'rust-mode
   :safe #'booleanp)
 
-(defcustom rust-indent-where-clause t
+(defcustom rust-indent-where-clause nil
   "Indent the line starting with the where keyword following a
 function or trait.  When nil, where will be aligned with fn or trait."
   :type 'boolean



reply via email to

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