summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorDavid Kellum <dek-oss@gravitext.com>2019-01-15 14:05:01 -0800
committerDavid Kellum <dek-oss@gravitext.com>2019-01-15 14:05:01 -0800
commit5f3734314de0e38f472740dfeeb0102ddc5d0b2c (patch)
treee95157ba0efbd95a280ade45bc12ac4819aa0c8b /rust-mode-tests.el
parentd3a70256fe560bcc463ed42e4259e9fce0fdfee3 (diff)
downloadrust-mode-5f3734314de0e38f472740dfeeb0102ddc5d0b2c.tar.gz
Add rust-indent-return-type-to-arguments variable
This preserves as default (t), the current indentation behavior of `-> ReturnType` when found on its own line: indenting as per the arguments of the above function. When disabled (nil) by the user, however, this will now just indent such a line one level from base-line (e.g. no special treatment). Includes a basic test.
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 9d87960..a5fea28 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -450,6 +450,17 @@ fn foo4(a:i32,
}
"))
+(ert-deftest indent-return-type-non-visual ()
+ (let ((rust-indent-return-type-to-arguments nil))
+(test-indent
+ "
+fn imagine_long_enough_to_wrap_at_arrow(a:i32, b:char)
+ -> i32
+{
+ let body;
+}
+")))
+
(ert-deftest indent-body-after-where ()
(let ((rust-indent-where-clause t))
(test-indent