@@ -101,33 +101,33 @@ pub enum CacheMiss {
101101pub enum FingerprintMismatch {
102102 /// Found a previous cache entry key for the same task, but the spawn fingerprint differs.
103103 /// This happens when the command itself or an env changes.
104- SpawnFingerprintMismatch {
104+ SpawnFingerprint {
105105 /// The fingerprint from the cached entry
106106 old : SpawnFingerprint ,
107107 /// The fingerprint of the current execution
108108 new : SpawnFingerprint ,
109109 } ,
110110 /// Found a previous cache entry key for the same task, but `input_config` or `glob_base` differs.
111- InputConfigChanged ,
111+ InputConfig ,
112112 /// Found the cache entry with the same spawn fingerprint, but an explicit globbed input changed
113- GlobbedInputChanged { path : RelativePathBuf } ,
113+ GlobbedInput { path : RelativePathBuf } ,
114114 /// Found the cache entry with the same spawn fingerprint, but the post-run fingerprint mismatches
115- PostRunFingerprintMismatch ( PostRunFingerprintMismatch ) ,
115+ PostRunFingerprint ( PostRunFingerprintMismatch ) ,
116116}
117117
118118impl Display for FingerprintMismatch {
119119 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
120120 match self {
121- Self :: SpawnFingerprintMismatch { old, new } => {
121+ Self :: SpawnFingerprint { old, new } => {
122122 write ! ( f, "Spawn fingerprint changed: old={old:?}, new={new:?}" )
123123 }
124- Self :: InputConfigChanged => {
124+ Self :: InputConfig => {
125125 write ! ( f, "inputs configuration changed" )
126126 }
127- Self :: GlobbedInputChanged { path } => {
127+ Self :: GlobbedInput { path } => {
128128 write ! ( f, "content of input '{path}' changed" )
129129 }
130- Self :: PostRunFingerprintMismatch ( diff) => Display :: fmt ( diff, f) ,
130+ Self :: PostRunFingerprint ( diff) => Display :: fmt ( diff, f) ,
131131 }
132132 }
133133}
@@ -222,7 +222,7 @@ impl ExecutionCache {
222222 cache_value. post_run_fingerprint . validate ( workspace_root) ?
223223 {
224224 return Ok ( Err ( CacheMiss :: FingerprintMismatch (
225- FingerprintMismatch :: PostRunFingerprintMismatch ( post_run_fingerprint_mismatch) ,
225+ FingerprintMismatch :: PostRunFingerprint ( post_run_fingerprint_mismatch) ,
226226 ) ) ) ;
227227 }
228228 // Associate the execution key to the cache entry key if not already,
@@ -237,14 +237,14 @@ impl ExecutionCache {
237237 self . get_cache_key_by_execution_key ( execution_cache_key) . await ?
238238 {
239239 // Determine what changed: spawn fingerprint or config (input_config / glob_base)
240- let mismatch = if old_cache_key. spawn_fingerprint != * spawn_fingerprint {
241- FingerprintMismatch :: SpawnFingerprintMismatch {
240+ let mismatch = if old_cache_key. spawn_fingerprint == * spawn_fingerprint {
241+ // spawn fingerprint is the same but input_config or glob_base changed
242+ FingerprintMismatch :: InputConfig
243+ } else {
244+ FingerprintMismatch :: SpawnFingerprint {
242245 old : old_cache_key. spawn_fingerprint ,
243246 new : spawn_fingerprint. clone ( ) ,
244247 }
245- } else {
246- // spawn fingerprint is the same but input_config or glob_base changed
247- FingerprintMismatch :: InputConfigChanged
248248 } ;
249249 return Ok ( Err ( CacheMiss :: FingerprintMismatch ( mismatch) ) ) ;
250250 }
@@ -291,21 +291,21 @@ fn detect_globbed_input_change(
291291 match ( s, c) {
292292 ( None , None ) => return None ,
293293 ( Some ( ( path, _) ) , None ) | ( None , Some ( ( path, _) ) ) => {
294- return Some ( FingerprintMismatch :: GlobbedInputChanged { path : path. clone ( ) } ) ;
294+ return Some ( FingerprintMismatch :: GlobbedInput { path : path. clone ( ) } ) ;
295295 }
296296 ( Some ( ( sp, sh) ) , Some ( ( cp, ch) ) ) => match sp. cmp ( cp) {
297297 std:: cmp:: Ordering :: Equal => {
298298 if sh != ch {
299- return Some ( FingerprintMismatch :: GlobbedInputChanged { path : sp. clone ( ) } ) ;
299+ return Some ( FingerprintMismatch :: GlobbedInput { path : sp. clone ( ) } ) ;
300300 }
301301 s = stored_iter. next ( ) ;
302302 c = current_iter. next ( ) ;
303303 }
304304 std:: cmp:: Ordering :: Less => {
305- return Some ( FingerprintMismatch :: GlobbedInputChanged { path : sp. clone ( ) } ) ;
305+ return Some ( FingerprintMismatch :: GlobbedInput { path : sp. clone ( ) } ) ;
306306 }
307307 std:: cmp:: Ordering :: Greater => {
308- return Some ( FingerprintMismatch :: GlobbedInputChanged { path : cp. clone ( ) } ) ;
308+ return Some ( FingerprintMismatch :: GlobbedInput { path : cp. clone ( ) } ) ;
309309 }
310310 } ,
311311 }
0 commit comments