mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Added where_trailing_comma option.
The default is 'false', since a lot of the time there's only a single predicate.
This commit is contained in:
@@ -316,6 +316,7 @@ fn default() -> Config {
|
||||
where_layout: ListTactic, ListTactic::Vertical, "Element layout inside a where clause";
|
||||
where_pred_indent: BlockIndentStyle, BlockIndentStyle::Visual,
|
||||
"Indentation style of a where predicate";
|
||||
where_trailing_comma: bool, false, "Put a trailing comma on where clauses";
|
||||
generics_indent: BlockIndentStyle, BlockIndentStyle::Visual, "Indentation of generics";
|
||||
struct_trailing_comma: SeparatorTactic, SeparatorTactic::Vertical,
|
||||
"If there is a trailing comma on structs";
|
||||
|
||||
+1
-1
@@ -1530,7 +1530,7 @@ fn rewrite_where_clause(context: &RewriteContext,
|
||||
let fmt = ListFormatting {
|
||||
tactic: tactic,
|
||||
separator: ",",
|
||||
trailing_separator: SeparatorTactic::Never,
|
||||
trailing_separator: SeparatorTactic::from_bool(context.config.where_trailing_comma),
|
||||
indent: offset,
|
||||
width: budget,
|
||||
ends_with_newline: true,
|
||||
|
||||
@@ -12,6 +12,7 @@ where_density = "Tall"
|
||||
where_indent = "Tabbed"
|
||||
where_layout = "Vertical"
|
||||
where_pred_indent = "Visual"
|
||||
where_trailing_comma = false
|
||||
generics_indent = "Visual"
|
||||
struct_trailing_comma = "Vertical"
|
||||
struct_lit_trailing_comma = "Vertical"
|
||||
|
||||
Reference in New Issue
Block a user