You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the if let of if line length is near max_width, then the control_brace_style option of rustfmt pushes the opening brace to the next line. (Notice that this option is still unstable.)
I observe this behaviour for "rustfmt 1.4.38-nightly (9257f5aa 2022-05-21)".
In the examples given below, the closing parenthesis character in the non-wrapped if let- an if- expressions is the 100th character in the line.
(A similar issue to the one shown in this example is mentioned here: #3560 (comment). In that one, the content of the if let is much less than max_width, but it gets folded like here, and the opening brace is pushed to the next line as well.)
I just want to note that AlwaysSameLine is the default, so at least the first buggy example should be reproducible with only stable options (or no options at all) and the others only really configure max_width which probably does not have anything to do with this bug, so the label is probably wrong
If the
if let
ofif
line length is nearmax_width
, then thecontrol_brace_style
option ofrustfmt
pushes the opening brace to the next line. (Notice that this option is still unstable.)I observe this behaviour for "rustfmt 1.4.38-nightly (9257f5aa 2022-05-21)".
In the examples given below, the closing parenthesis character in the non-wrapped
if let
- anif
- expressions is the 100th character in the line."AlwaysSameLine"
The formatting does match the expectations neither for
if let
, nor forif
:"AlwaysSameLine"
+max_width=102
The formatting matches the expectations for both
if let
andif
:"AlwaysSameLine"
+max_width=99
The formatting does match the expectations for
if let
, but matches the expectations forif
:(A similar issue to the one shown in this example is mentioned here: #3560 (comment). In that one, the content of the
if let
is much less thanmax_width
, but it gets folded like here, and the opening brace is pushed to the next line as well.)"AlwaysNextLine"
The formatting matches the expectations for both
if let
andif
:The text was updated successfully, but these errors were encountered: