File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ enum CommandState<'a> {
40
40
} ,
41
41
}
42
42
43
+ #[ must_use]
43
44
pub struct DeferredCommand < ' a > {
44
45
state : CommandState < ' a > ,
45
46
}
@@ -122,11 +123,11 @@ impl ExecutionContext {
122
123
stdout : OutputMode ,
123
124
stderr : OutputMode ,
124
125
) -> DeferredCommand < ' a > {
125
- command. mark_as_executed ( ) ;
126
126
let cache_key = command. cache_key ( ) ;
127
127
128
128
if let Some ( cached_output) = cache_key. as_ref ( ) . and_then ( |key| self . command_cache . get ( key) )
129
129
{
130
+ command. mark_as_executed ( ) ;
130
131
self . verbose ( || println ! ( "Cache hit: {command:?}" ) ) ;
131
132
return DeferredCommand { state : CommandState :: Cached ( cached_output) } ;
132
133
}
@@ -244,6 +245,8 @@ impl<'a> DeferredCommand<'a> {
244
245
executed_at : & ' a std:: panic:: Location < ' a > ,
245
246
exec_ctx : & ExecutionContext ,
246
247
) -> CommandOutput {
248
+ command. mark_as_executed ( ) ;
249
+
247
250
let process = match process. take ( ) {
248
251
Some ( p) => p,
249
252
None => return CommandOutput :: default ( ) ,
You can’t perform that action at this time.
0 commit comments