diff options
| author | est31 <MTest31@outlook.com> | 2017-06-06 03:11:17 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2017-06-06 03:50:58 +0200 |
| commit | aa4cd311bb07ea25d89096e8fdd5d64b73666c28 (patch) | |
| tree | 8eda35fc415720f1954538e6843e46a56e653f59 /Configurations.md | |
| parent | d04ab9e5ba46b21a49027ce38dc913b4617125ba (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 'Configurations.md')
| -rw-r--r-- | Configurations.md | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Configurations.md b/Configurations.md index a0c6ba407d9..0b0a5570356 100644 --- a/Configurations.md +++ b/Configurations.md @@ -1123,6 +1123,33 @@ fn lorem<T: Eq>(t: T) { See also: [`space_before_bound`](#space_before_bound). +## `space_after_struct_lit_field_colon` + +Leave a space after the colon in a struct literal field + +- **Default value**: `true` +- **Possible values**: `true`, `false` + +#### `false`: + +```rust +let lorem = Lorem { + ipsum:dolor, + sit:amet, +}; +``` + +#### `true`: + +```rust +let lorem = Lorem { + ipsum: dolor, + sit: amet, +}; +``` + +See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon). + ## `space_after_type_annotation_colon` Leave a space after the colon in a type annotation @@ -1173,6 +1200,33 @@ fn lorem<T : Eq>(t: T) { See also: [`space_after_bound_colon`](#space_after_bound_colon). +## `space_before_struct_lit_field_colon` + +Leave a space before the colon in a struct literal field + +- **Default value**: `true` +- **Possible values**: `true`, `false` + +#### `false`: + +```rust +let lorem = Lorem { + ipsum: dolor, + sit: amet, +}; +``` + +#### `true`: + +```rust +let lorem = Lorem { + ipsum : dolor, + sit : amet, +}; +``` + +See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon). + ## `space_before_type_annotation` Leave a space before the colon in a type annotation |
