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

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

[nongnu] elpa/rust-mode 9640fe8 051/486: Indent return type to align wit


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 9640fe8 051/486: Indent return type to align with arguments
Date: Sat, 7 Aug 2021 09:24:46 -0400 (EDT)

branch: elpa/rust-mode
commit 9640fe89c1e15c869500cf1057fd40c7b1c4fd10
Author: Micah Chalmer <micah@micahchalmer.net>
Commit: Micah Chalmer <micah@micahchalmer.net>

    Indent return type to align with arguments
---
 rust-mode.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/rust-mode.el b/rust-mode.el
index ff91192..d7c4142 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -62,8 +62,11 @@
            (back-to-indentation)
            (let ((level (rust-paren-level)))
              (cond
-              ;; A function return type is 1 level indented
-              ((looking-at "->") (* rust-indent-offset (+ level 1)))
+              ;; A function return type is indented to the corresponding 
function arguments
+              ((looking-at "->")
+               (save-excursion
+                 (backward-list)
+                 (rust-first-indent-after-brace)))
 
               ;; A closing brace is 1 level unindended
               ((looking-at "}") (* rust-indent-offset (- level 1)))



reply via email to

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