From 707a2963772e655fbf2231aa27c5a83c330f90c0 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Tue, 14 Nov 2017 10:49:18 +0900 Subject: [PATCH] Update Configurations.md --- Configurations.md | 101 ++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 52 deletions(-) diff --git a/Configurations.md b/Configurations.md index 6516784c481..31e5855bfaa 100644 --- a/Configurations.md +++ b/Configurations.md @@ -840,13 +840,15 @@ fn lorem } ``` -## `fn_brace_style` +## `brace_style` -Brace style for functions +Brace style for items - **Default value**: `"SameLineWhere"` - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"` +### Functions + #### `"SameLineWhere"` (default): ```rust @@ -905,6 +907,50 @@ where } ``` +### Structs and enums + +#### `"SameLineWhere"` (default): + +```rust +struct Lorem { + ipsum: bool, +} + +struct Dolor + where T: Eq +{ + sit: T, +} +``` + +#### `"AlwaysNextLine"`: + +```rust +struct Lorem +{ + ipsum: bool, +} + +struct Dolor + where T: Eq +{ + sit: T, +} +``` + +#### `"PreferSameLine"`: + +```rust +struct Lorem { + ipsum: bool, +} + +struct Dolor + where T: Eq { + sit: T, +} +``` + ## `fn_call_width` Maximum width of the args of a function call before falling back to vertical formatting @@ -1125,7 +1171,7 @@ impl Lorem { } ``` -See also [`item_brace_style`](#item_brace_style). +See also [`brace_style`](#brace_style). ## `indent_match_arms` @@ -1239,55 +1285,6 @@ use foo::{aaa, fff}; ``` -## `item_brace_style` - -Brace style for structs and enums - -- **Default value**: `"SameLineWhere"` -- **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"` - -#### `"SameLineWhere"` (default): - -```rust -struct Lorem { - ipsum: bool, -} - -struct Dolor - where T: Eq -{ - sit: T, -} -``` - -#### `"AlwaysNextLine"`: - -```rust -struct Lorem -{ - ipsum: bool, -} - -struct Dolor - where T: Eq -{ - sit: T, -} -``` - -#### `"PreferSameLine"`: - -```rust -struct Lorem { - ipsum: bool, -} - -struct Dolor - where T: Eq { - sit: T, -} -``` - ## `match_arm_forces_newline` Consistently put match arms (block based or not) in a newline.