@@ -1742,7 +1742,14 @@ fn compare_old_fingerprint(
1742
1742
mtime_on_use : bool ,
1743
1743
forced : bool ,
1744
1744
) -> Option < DirtyReason > {
1745
- let compare = _compare_old_fingerprint ( old_hash_path, new_fingerprint, mtime_on_use) ;
1745
+ if mtime_on_use {
1746
+ // update the mtime so other cleaners know we used it
1747
+ let t = FileTime :: from_system_time ( SystemTime :: now ( ) ) ;
1748
+ debug ! ( "mtime-on-use forcing {:?} to {}" , old_hash_path, t) ;
1749
+ paths:: set_file_time_no_err ( old_hash_path, t) ;
1750
+ }
1751
+
1752
+ let compare = _compare_old_fingerprint ( old_hash_path, new_fingerprint) ;
1746
1753
log_compare ( unit, & compare) ;
1747
1754
match compare {
1748
1755
Ok ( None ) if forced => Some ( DirtyReason :: Forced ) ,
@@ -1754,17 +1761,9 @@ fn compare_old_fingerprint(
1754
1761
fn _compare_old_fingerprint (
1755
1762
old_hash_path : & Path ,
1756
1763
new_fingerprint : & Fingerprint ,
1757
- mtime_on_use : bool ,
1758
1764
) -> CargoResult < Option < DirtyReason > > {
1759
1765
let old_fingerprint_short = paths:: read ( old_hash_path) ?;
1760
1766
1761
- if mtime_on_use {
1762
- // update the mtime so other cleaners know we used it
1763
- let t = FileTime :: from_system_time ( SystemTime :: now ( ) ) ;
1764
- debug ! ( "mtime-on-use forcing {:?} to {}" , old_hash_path, t) ;
1765
- paths:: set_file_time_no_err ( old_hash_path, t) ;
1766
- }
1767
-
1768
1767
let new_hash = new_fingerprint. hash_u64 ( ) ;
1769
1768
1770
1769
if util:: to_hex ( new_hash) == old_fingerprint_short && new_fingerprint. fs_status . up_to_date ( ) {
0 commit comments