about summary refs log tree commit diff
path: root/tests/source
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2017-06-06 03:11:17 +0200
committerest31 <MTest31@outlook.com>2017-06-06 03:50:58 +0200
commitaa4cd311bb07ea25d89096e8fdd5d64b73666c28 (patch)
tree8eda35fc415720f1954538e6843e46a56e653f59 /tests/source
parentd04ab9e5ba46b21a49027ce38dc913b4617125ba (diff)
Add config options for spaces around the colon in struct literal fields
In Rust, colons are used for three purposes:

* Type annotations, including type ascription
* Trait bounds
* Struct literal fields

This commit adds options for the last missing of the three purposes,
struct literal fields.
Diffstat (limited to 'tests/source')
-rw-r--r--tests/source/configs-space_after_struct_lit_field_colon-false.rs6
-rw-r--r--tests/source/configs-space_after_struct_lit_field_colon-true.rs6
-rw-r--r--tests/source/configs-space_before_struct_lit_field_colon-false.rs6
-rw-r--r--tests/source/configs-space_before_struct_lit_field_colon-true.rs6
4 files changed, 24 insertions, 0 deletions
diff --git a/tests/source/configs-space_after_struct_lit_field_colon-false.rs b/tests/source/configs-space_after_struct_lit_field_colon-false.rs
new file mode 100644
index 00000000000..3ee99fa5d1d
--- /dev/null
+++ b/tests/source/configs-space_after_struct_lit_field_colon-false.rs
@@ -0,0 +1,6 @@
+// rustfmt-space_after_struct_lit_field_colon: false
+
+const LOREM: Lorem = Lorem {
+    ipsum:dolor,
+    sit :  amet,
+};
diff --git a/tests/source/configs-space_after_struct_lit_field_colon-true.rs b/tests/source/configs-space_after_struct_lit_field_colon-true.rs
new file mode 100644
index 00000000000..6105d4725d8
--- /dev/null
+++ b/tests/source/configs-space_after_struct_lit_field_colon-true.rs
@@ -0,0 +1,6 @@
+// rustfmt-space_after_struct_lit_field_colon: true
+
+const LOREM: Lorem = Lorem {
+    ipsum:dolor,
+    sit :  amet,
+};
diff --git a/tests/source/configs-space_before_struct_lit_field_colon-false.rs b/tests/source/configs-space_before_struct_lit_field_colon-false.rs
new file mode 100644
index 00000000000..a2d71c8bf0b
--- /dev/null
+++ b/tests/source/configs-space_before_struct_lit_field_colon-false.rs
@@ -0,0 +1,6 @@
+// rustfmt-space_before_struct_lit_field_colon: false
+
+const LOREM: Lorem = Lorem {
+    ipsum:dolor,
+    sit  : amet,
+};
diff --git a/tests/source/configs-space_before_struct_lit_field_colon-true.rs b/tests/source/configs-space_before_struct_lit_field_colon-true.rs
new file mode 100644
index 00000000000..50e4ba12d82
--- /dev/null
+++ b/tests/source/configs-space_before_struct_lit_field_colon-true.rs
@@ -0,0 +1,6 @@
+// rustfmt-space_before_struct_lit_field_colon: true
+
+const LOREM: Lorem = Lorem {
+    ipsum:dolor,
+    sit  : amet,
+};