File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -457,3 +457,44 @@ pub enum MatchArmLeadingPipe {
457
457
/// Preserve any existing leading pipes
458
458
Preserve ,
459
459
}
460
+
461
+ /// Controls how "right-hand" expressions (assignment and match bodies)
462
+ /// should be rendered if the right-hand side does not fit on a single line
463
+ /// but might possibly fit on a single line if we newline-indent.
464
+ #[ config_type]
465
+ pub enum RightHandIndentationStrategy {
466
+ /// Use the `prefer_next_line` heuristic (default behavior, equivalent to old
467
+ /// rustfmt versions that did not support this option).
468
+ ///
469
+ /// let foo =
470
+ /// bar().baz().boo();
471
+ ///
472
+ /// | SomeEnum =>
473
+ /// bar().baz().boo()
474
+ Heuristic ,
475
+ /// If the expression doesn't fit on a single line, split it but leave the first
476
+ /// line on the same line as the left-hand (even if indenting may have the expression
477
+ /// fit entirely):
478
+ ///
479
+ /// let foo = bar()
480
+ /// .baz()
481
+ /// .boo();
482
+ ///
483
+ /// | SomeEnum => bar()
484
+ /// .baz()
485
+ /// .boo()
486
+ SameLineAsLHS ,
487
+ /// If the expression doesn't fit on a single line, split it and indent the first
488
+ /// line on the line below the left-hand.
489
+ ///
490
+ /// let foo =
491
+ /// bar()
492
+ /// .baz()
493
+ /// .boo();
494
+ ///
495
+ /// | SomeEnum =>
496
+ /// bar()
497
+ /// .baz()
498
+ /// .boo()
499
+ NewlineIndentRHS ,
500
+ }
You can’t perform that action at this time.
0 commit comments