Description
On Windows, using the default newline style (either without rustfmt.toml
or by explicitly setting newline_style="Auto"
:
- leaves the newlines intact if the file does not have any formatting issues (ok, expected)
- saves modified files with Unix-style endings, even when all line-breaks in the input file are CRLF.
I would expect that in such cases the "Auto" value would use the line-break style inferred from examining the file.
Version used: rustfmt 1.4.11-stable (9eb4b564 2020-01-29)
as invoked via the cargo fmt
command, version cargo 1.42.0 (86334295e 2020-01-31)
It's possible to work around this by forcing "Native" style in the rustfmt.toml
but the default behaviour results in a mixture of line-ending styles throughout the project and triggers git line-ending conversion warnings.