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
The code is basically a longer version of Clippy's manual flatten example, with the iterable inline. If the for line is long enough:
let an_item = None;let an_other_item = None;formut a_nice_declarative_name in[Some("a value"),
an_item,Some("an other value"),
an_other_item,Some("more"),Some("stuff"),Some("again"),].into_iter().flatten(){println!("{}", a_nice_declarative_name);}
gets reformatted to
formut a_nice_declarative_name in[Some("a value"),
an_item,Some("an other value"),
an_other_item,Some("more"),Some("stuff"),Some("again"),].into_iter().flatten(){println!("{}", a_nice_declarative_name);}
the lone block brackets, and methods floating in the middle, feel and read very odd. I actually spent a few seconds wondering why I had put the actual code (whose body is quite a bit more complicated) inside its own block after rustfmt ran on it, interpreting it as a sub-scope rather than what it is (a loop body).
The text was updated successfully, but these errors were encountered:
Thanks for sharing your perspective but I'm going to close because this is correct, expected formatting per the governing Style Guide.
You may be interested in reviewing issues like #4306 (comment) which outlines some (non-default) options we're exploring that would give you the flexibility to maintain the type of formatting you'd authored
The code is basically a longer version of Clippy's manual flatten example, with the iterable inline. If the
for
line is long enough:gets reformatted to
the lone block brackets, and methods floating in the middle, feel and read very odd. I actually spent a few seconds wondering why I had put the actual code (whose body is quite a bit more complicated) inside its own block after rustfmt ran on it, interpreting it as a sub-scope rather than what it is (a loop body).
The text was updated successfully, but these errors were encountered: