Skip to content

Commit 76e95a0

Browse files
committed
Indent return type to align with arguments
1 parent 9ef0b9c commit 76e95a0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/etc/emacs/rust-mode.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@
6262
(back-to-indentation)
6363
(let ((level (rust-paren-level)))
6464
(cond
65-
;; A function return type is 1 level indented
66-
((looking-at "->") (* rust-indent-offset (+ level 1)))
65+
;; A function return type is indented to the corresponding function arguments
66+
((looking-at "->")
67+
(save-excursion
68+
(backward-list)
69+
(rust-first-indent-after-brace)))
6770

6871
;; A closing brace is 1 level unindended
6972
((looking-at "}") (* rust-indent-offset (- level 1)))

0 commit comments

Comments
 (0)