Skip to content

Commit 7f21fae

Browse files
committed
Make depinfo parsing more reorder tolerant
1 parent c755949 commit 7f21fae

File tree

1 file changed

+2
-4
lines changed
  • src/cargo/core/compiler/fingerprint

1 file changed

+2
-4
lines changed

src/cargo/core/compiler/fingerprint/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ pub fn parse_rustc_dep_info(rustc_dep_info: &Path) -> CargoResult<RustcDepInfo>
23892389
internal("malformed dep-info format, trailing \\".to_string())
23902390
})?);
23912391
}
2392-
ret.files.insert(file.into(), None);
2392+
ret.files.entry(file.into()).or_insert(None);
23932393
}
23942394
} else if let Some(rest) = line.strip_prefix("# checksum:") {
23952395
let mut parts = rest.splitn(3, ' ');
@@ -2406,9 +2406,7 @@ pub fn parse_rustc_dep_info(rustc_dep_info: &Path) -> CargoResult<RustcDepInfo>
24062406
continue;
24072407
};
24082408

2409-
if let Some(entry) = ret.files.get_mut(&path) {
2410-
*entry = Some((file_len, checksum));
2411-
}
2409+
ret.files.insert(path, Some((file_len, checksum)));
24122410
}
24132411
}
24142412
return Ok(ret);

0 commit comments

Comments
 (0)