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 updated my toolchain (and unfortunately I don't know what the previous version was) and with the latest cargo every time it touches the Cargo.lock it adds 2 new-lines at the end of the file. (Just to be clear: it does not append 2 new-lines every time but the end result of the generation is 2 new-lines at the end of the file.)
The expectation is to have a single new-line at the end of the file.
Steps
Delete Cargo.lock and possibly the target folder
Run cargo build|run|test commands
Inspect Cargo.lock
Notes
Output of cargo version: cargo 1.38.0 (23ef9a4ef 2019-08-20) but the same happens with cargo 1.40.0-nightly (3a9abe3f0 2019-10-15) as well
The text was updated successfully, but these errors were encountered:
I think this is somewhat intentional. Cargo has historically had a blank line at the end. There was an accidental regression on beta/nightly back in August (#7262) where it removed the blank line, but it was reverted for the stable release. Perhaps your lock file came from during that time?
There will be a new lock file format on the horizon, which removes the pesky blank line.
@ehuss It did, indeed! The new format is wonderful news. Just out of curiosity, what possible advantage could the extra line at the end of the file has?
what possible advantage could the extra line at the end of the file has?
There is none that I know of, I think it was just an artifact of how it was initially implemented. The PR mentioned above keeps the old style just so it doesn't cause needless churn for people who check the lock file into source control.
Problem
I updated my toolchain (and unfortunately I don't know what the previous version was) and with the latest
cargo
every time it touches theCargo.lock
it adds 2 new-lines at the end of the file. (Just to be clear: it does not append 2 new-lines every time but the end result of the generation is 2 new-lines at the end of the file.)The expectation is to have a single new-line at the end of the file.
Steps
Cargo.lock
and possibly thetarget
foldercargo build|run|test
commandsCargo.lock
Notes
Output of
cargo version
:cargo 1.38.0 (23ef9a4ef 2019-08-20)
but the same happens withcargo 1.40.0-nightly (3a9abe3f0 2019-10-15)
as wellThe text was updated successfully, but these errors were encountered: