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
I have a project where many files have Windows line endings. I set newline_style to Unix and ran cargo fmt, expecting the files to be reformatted, but they are not unless there is some other non-line-ending change being made.
Interestingly, the opposite is not true: if I explicitly set newline_style to Windows, then any Unix-formatted files are rewritten even if there is no other reformatting to do.
To repro this:
cargo init
git add .
cargo fmt -- --config newline_style=Windows
git diff # see that src/main.rs has been reformatted with Windows line endings
git add -u
cargo fmt -- --config newline_style=Unix
git diff # see that there are no changes--src/main.rs still has Windows line endings
The text was updated successfully, but these errors were encountered:
I have a project where many files have Windows line endings. I set newline_style to Unix and ran cargo fmt, expecting the files to be reformatted, but they are not unless there is some other non-line-ending change being made.
Interestingly, the opposite is not true: if I explicitly set newline_style to Windows, then any Unix-formatted files are rewritten even if there is no other reformatting to do.
To repro this:
The text was updated successfully, but these errors were encountered: