Skip to content

Commit d3a3c32

Browse files
committed
refactor: call log_compare in fingerprint compare fn
1 parent 95e113c commit d3a3c32

File tree

1 file changed

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

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ pub fn prepare_target(cx: &mut Context<'_, '_>, unit: &Unit, force: bool) -> Car
415415
// information about failed comparisons to aid in debugging.
416416
let fingerprint = calculate(cx, unit)?;
417417
let mtime_on_use = cx.bcx.config.cli_unstable().mtime_on_use;
418-
let compare = compare_old_fingerprint(&loc, &*fingerprint, mtime_on_use);
419-
log_compare(unit, &compare);
418+
let compare = compare_old_fingerprint(unit, &loc, &*fingerprint, mtime_on_use);
420419

421420
// If our comparison failed or reported dirty (e.g., we're going to trigger
422421
// a rebuild of this crate), then we also ensure the source of the crate
@@ -1752,6 +1751,17 @@ fn target_root(cx: &Context<'_, '_>) -> PathBuf {
17521751
/// If dirty, it then restores the detailed information
17531752
/// from the fingerprint JSON file, and provides an rich dirty reason.
17541753
fn compare_old_fingerprint(
1754+
unit: &Unit,
1755+
old_hash_path: &Path,
1756+
new_fingerprint: &Fingerprint,
1757+
mtime_on_use: bool,
1758+
) -> CargoResult<Option<DirtyReason>> {
1759+
let compare = _compare_old_fingerprint(old_hash_path, new_fingerprint, mtime_on_use);
1760+
log_compare(unit, &compare);
1761+
compare
1762+
}
1763+
1764+
fn _compare_old_fingerprint(
17551765
old_hash_path: &Path,
17561766
new_fingerprint: &Fingerprint,
17571767
mtime_on_use: bool,

0 commit comments

Comments
 (0)