@@ -40,7 +40,7 @@ pub fn get_display_command(display_options: DisplayOptions, task: &ResolvedTask)
4040 let cwd = task. resolved_command . fingerprint . cwd . as_str ( ) ;
4141 Some ( format ! (
4242 "{}$ {}" ,
43- if cwd. is_empty( ) { format_args!( "" ) } else { format_args!( "~/{}" , cwd ) } ,
43+ if cwd. is_empty( ) { format_args!( "" ) } else { format_args!( "~/{cwd}" ) } ,
4444 display_command
4545 ) )
4646}
@@ -56,12 +56,12 @@ impl Display for PreExecutionStatus {
5656 // No message for "Cache not found" as requested
5757 tracing:: debug!( "{}" , "Cache not found" . style( CACHE_MISS_STYLE ) ) ;
5858 if let Some ( display_command) = & display_command {
59- writeln ! ( f, "{}" , display_command ) ?;
59+ writeln ! ( f, "{display_command}" ) ?;
6060 }
6161 }
6262 CacheStatus :: CacheMiss ( CacheMiss :: FingerprintMismatch ( mismatch) ) => {
6363 if let Some ( display_command) = & display_command {
64- write ! ( f, "{} " , display_command ) ?;
64+ write ! ( f, "{display_command } " ) ?;
6565 }
6666
6767 let current = & self . task . resolved_command . fingerprint ;
@@ -71,22 +71,22 @@ impl Display for PreExecutionStatus {
7171 // For now, just say "command changed" for any command fingerprint mismatch
7272 // The detailed analysis will be in the summary
7373 if previous. command != current. command {
74- format ! ( "command changed" )
74+ "command changed" . to_string ( )
7575 } else if previous. cwd != current. cwd {
76- format ! ( "working directory changed" )
76+ "working directory changed" . to_string ( )
7777 } else if previous. envs_without_pass_through
7878 != current. envs_without_pass_through
7979 || previous. pass_through_envs != current. pass_through_envs
8080 {
81- format ! ( "envs changed" )
81+ "envs changed" . to_string ( )
8282 } else {
83- format ! ( "command configuration changed" )
83+ "command configuration changed" . to_string ( )
8484 }
8585 }
8686 FingerprintMismatch :: PostRunFingerprintMismatch (
8787 PostRunFingerprintMismatch :: InputContentChanged { path } ,
8888 ) => {
89- format ! ( "content of input '{}' changed" , path )
89+ format ! ( "content of input '{path }' changed" )
9090 }
9191 } ;
9292 writeln ! (
@@ -104,7 +104,7 @@ impl Display for PreExecutionStatus {
104104 CacheStatus :: CacheHit { .. } => {
105105 if !self . display_options . ignore_replay {
106106 if let Some ( display_command) = & display_command {
107- write ! ( f, "{} " , display_command ) ?;
107+ write ! ( f, "{display_command } " ) ?;
108108 }
109109 writeln ! (
110110 f,
@@ -176,20 +176,20 @@ impl Display for ExecutionSummary {
176176 f,
177177 "{} {} {} {} {}" ,
178178 "Statistics:" . style( Style :: new( ) . bold( ) ) ,
179- format!( " {} tasks" , total ) . style( Style :: new( ) . bright_white( ) ) ,
180- format!( "• {} cache hits" , cache_hits ) . style( Style :: new( ) . green( ) ) ,
181- format!( "• {} cache misses" , cache_misses ) . style( CACHE_MISS_STYLE ) ,
179+ format!( " {total } tasks" ) . style( Style :: new( ) . bright_white( ) ) ,
180+ format!( "• {cache_hits } cache hits" ) . style( Style :: new( ) . green( ) ) ,
181+ format!( "• {cache_misses } cache misses" ) . style( CACHE_MISS_STYLE ) ,
182182 if failed > 0 {
183- format!( "• {} failed" , failed ) . style( Style :: new( ) . red( ) ) . to_string( )
183+ format!( "• {failed } failed" ) . style( Style :: new( ) . red( ) ) . to_string( )
184184 } else if skipped > 0 {
185- format!( "• {} skipped" , skipped ) . style( Style :: new( ) . bright_black( ) ) . to_string( )
185+ format!( "• {skipped } skipped" ) . style( Style :: new( ) . bright_black( ) ) . to_string( )
186186 } else {
187187 String :: new( )
188188 }
189189 ) ?;
190190
191191 let cache_rate =
192- if total > 0 { ( cache_hits as f64 / total as f64 * 100.0 ) as u32 } else { 0 } ;
192+ if total > 0 { ( f64:: from ( cache_hits ) / total as f64 * 100.0 ) as u32 } else { 0 } ;
193193
194194 let total_duration = self
195195 . execution_statuses
@@ -209,7 +209,7 @@ impl Display for ExecutionSummary {
209209 f,
210210 "{} {} cache hit rate" ,
211211 "Performance:" . style( Style :: new( ) . bold( ) ) ,
212- format_args!( "{}%" , cache_rate ) . style( if cache_rate >= 75 {
212+ format_args!( "{cache_rate }%" ) . style( if cache_rate >= 75 {
213213 Style :: new( ) . green( ) . bold( )
214214 } else if cache_rate >= 50 {
215215 CACHE_MISS_STYLE
@@ -260,7 +260,7 @@ impl Display for ExecutionSummary {
260260 f,
261261 " {} {}" ,
262262 "✗" . style( Style :: new( ) . red( ) . bold( ) ) ,
263- format!( "(exit code: {})" , exit_status ) . style( Style :: new( ) . red( ) )
263+ format!( "(exit code: {exit_status })" ) . style( Style :: new( ) . red( ) )
264264 ) ?;
265265 }
266266 Err ( ExecutionFailure :: SkippedDueToFailedDependency ) => {
@@ -281,7 +281,7 @@ impl Display for ExecutionSummary {
281281 f,
282282 " {} {}" ,
283283 "→ Cache hit - output replayed" . style( Style :: new( ) . green( ) ) ,
284- format!( "- {:.2?} saved" , original_duration ) . style( Style :: new( ) . green( ) )
284+ format!( "- {original_duration :.2?} saved" ) . style( Style :: new( ) . green( ) )
285285 ) ?;
286286 }
287287 CacheStatus :: CacheMiss ( miss) => {
@@ -312,7 +312,7 @@ impl Display for ExecutionSummary {
312312 if previous_command_fingerprint. cwd
313313 != current_command_fingerprint. cwd
314314 {
315- fn display_cwd ( cwd : & RelativePath ) -> & str {
315+ const fn display_cwd ( cwd : & RelativePath ) -> & str {
316316 if cwd. as_str ( ) . is_empty ( ) { "." } else { cwd. as_str ( ) }
317317 }
318318 changes. push ( format ! (
@@ -353,22 +353,16 @@ impl Display for ExecutionSummary {
353353 {
354354 if & previous_env_value != current_value {
355355 changes. push ( format ! (
356- "env {} value changed from '{}' to '{}'" ,
357- key, previous_env_value, current_value,
356+ "env {key} value changed from '{previous_env_value}' to '{current_value}'" ,
358357 ) ) ;
359358 }
360359 } else {
361- changes. push ( format ! (
362- "env {}={} added" ,
363- key, current_value,
364- ) ) ;
360+ changes
361+ . push ( format ! ( "env {key}={current_value} added" , ) ) ;
365362 }
366363 }
367364 for ( key, previous_value) in previous_envs {
368- changes. push ( format ! (
369- "env {}={} removed" ,
370- key, previous_value
371- ) ) ;
365+ changes. push ( format ! ( "env {key}={previous_value} removed" ) ) ;
372366 }
373367
374368 if changes. is_empty ( ) {
@@ -391,7 +385,7 @@ impl Display for ExecutionSummary {
391385 writeln ! (
392386 f,
393387 "{}" ,
394- format!( "content of input '{}' changed" , path )
388+ format!( "content of input '{path }' changed" )
395389 . style( CACHE_MISS_STYLE )
396390 ) ?;
397391 }
0 commit comments