Skip to content

Commit 32fbfe3

Browse files
committed
Explain why top comments are preserved in Cargo.lock
1 parent ce40ab8 commit 32fbfe3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cargo/ops/lockfile.rs

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ pub fn write_pkg_lockfile(ws: &Workspace, resolve: &Resolve) -> CargoResult<()>
4343

4444
let mut out = String::new();
4545

46+
// Preserve the top comments in the lockfile
47+
// This is in preparation for marking it as generated
48+
// https://github.com/rust-lang/cargo/issues/6180
4649
if let Ok(orig) = &orig {
4750
for line in orig.lines().take_while(|line| line.starts_with("#")) {
4851
out.push_str(line);

0 commit comments

Comments
 (0)