@@ -80,7 +80,9 @@ pub fn format_single_task(task: &CachingTask) -> String {
8080 let stage_info = if let Some ( stage) = & task. stage {
8181 let step_str = if let Some ( step) = task. current_step {
8282 let total = stage. total_steps ( ) ;
83- let desc = task. step_description . as_ref ( )
83+ let desc = task
84+ . step_description
85+ . as_ref ( )
8486 . map ( |d| format ! ( ": {}" , d) )
8587 . unwrap_or_default ( ) ;
8688 format ! ( "\n **Step**: {} of {}{}" , step, total, desc)
@@ -263,7 +265,8 @@ pub fn format_task_list(tasks: Vec<CachingTask>) -> String {
263265 }
264266 }
265267
266- let total = in_progress. len ( ) + completed. len ( ) + failed. len ( ) + cancelled. len ( ) + pending. len ( ) ;
268+ let total =
269+ in_progress. len ( ) + completed. len ( ) + failed. len ( ) + cancelled. len ( ) + pending. len ( ) ;
267270
268271 // Build summary
269272 let mut output = String :: from ( "# Caching Operations\n \n " ) ;
@@ -339,7 +342,9 @@ pub fn format_task_list(tasks: Vec<CachingTask>) -> String {
339342 output. push_str ( "- **Cancel tasks**: Use `cache_operations` with task_id and cancel: true for each task\n " ) ;
340343 }
341344 if !completed. is_empty ( ) || !failed. is_empty ( ) || !cancelled. is_empty ( ) {
342- output. push_str ( "- **Clear all completed/failed/cancelled**: `cache_operations({clear: true})`\n " ) ;
345+ output. push_str (
346+ "- **Clear all completed/failed/cancelled**: `cache_operations({clear: true})`\n " ,
347+ ) ;
343348 }
344349
345350 output
@@ -355,7 +360,12 @@ fn format_task_summary(task: &CachingTask) -> String {
355360
356361 let mut output = format ! (
357362 "### Task: `{}`\n **Crate**: {}-{} \n **Source**: {}{} \n **Status**: {} \n " ,
358- task. task_id, task. crate_name, task. version, task. source_type, source_info, task. status. display( )
363+ task. task_id,
364+ task. crate_name,
365+ task. version,
366+ task. source_type,
367+ source_info,
368+ task. status. display( )
359369 ) ;
360370
361371 match task. status {
@@ -365,30 +375,59 @@ fn format_task_summary(task: &CachingTask) -> String {
365375
366376 if let Some ( step) = task. current_step {
367377 let total = stage. total_steps ( ) ;
368- let desc = task. step_description . as_ref ( )
378+ let desc = task
379+ . step_description
380+ . as_ref ( )
369381 . map ( |d| format ! ( ": {}" , d) )
370382 . unwrap_or_default ( ) ;
371383 output. push_str ( & format ! ( "**Step**: {} of {}{} \n " , step, total, desc) ) ;
372384 }
373385 }
374- output. push_str ( & format ! ( "**Started**: {} \n " , format_timestamp( task. started_at) ) ) ;
375- output. push_str ( & format ! ( "**Elapsed**: {}\n \n " , format_duration( task. elapsed_secs( ) ) ) ) ;
386+ output. push_str ( & format ! (
387+ "**Started**: {} \n " ,
388+ format_timestamp( task. started_at)
389+ ) ) ;
390+ output. push_str ( & format ! (
391+ "**Elapsed**: {}\n \n " ,
392+ format_duration( task. elapsed_secs( ) )
393+ ) ) ;
376394 output. push_str ( "**Actions**:\n " ) ;
377- output. push_str ( & format ! ( "- Cancel: `cache_operations({{task_id: \" {}\" , cancel: true}})`\n " , task. task_id) ) ;
395+ output. push_str ( & format ! (
396+ "- Cancel: `cache_operations({{task_id: \" {}\" , cancel: true}})`\n " ,
397+ task. task_id
398+ ) ) ;
378399 }
379400 TaskStatus :: Pending => {
380- output. push_str ( & format ! ( "**Started**: {} \n " , format_timestamp( task. started_at) ) ) ;
401+ output. push_str ( & format ! (
402+ "**Started**: {} \n " ,
403+ format_timestamp( task. started_at)
404+ ) ) ;
381405 output. push_str ( "\n **Actions**:\n " ) ;
382- output. push_str ( & format ! ( "- Cancel: `cache_operations({{task_id: \" {}\" , cancel: true}})`\n " , task. task_id) ) ;
406+ output. push_str ( & format ! (
407+ "- Cancel: `cache_operations({{task_id: \" {}\" , cancel: true}})`\n " ,
408+ task. task_id
409+ ) ) ;
383410 }
384411 TaskStatus :: Completed => {
385- output. push_str ( & format ! ( "**Duration**: {} \n " , format_duration( task. elapsed_secs( ) ) ) ) ;
386- output. push_str ( & format ! ( "**Completed**: {}\n \n " , format_timestamp( task. completed_at. unwrap_or( task. started_at) ) ) ) ;
412+ output. push_str ( & format ! (
413+ "**Duration**: {} \n " ,
414+ format_duration( task. elapsed_secs( ) )
415+ ) ) ;
416+ output. push_str ( & format ! (
417+ "**Completed**: {}\n \n " ,
418+ format_timestamp( task. completed_at. unwrap_or( task. started_at) )
419+ ) ) ;
387420 output. push_str ( "**Actions**:\n " ) ;
388- output. push_str ( & format ! ( "- Clear: `cache_operations({{task_id: \" {}\" , clear: true}})`\n " , task. task_id) ) ;
421+ output. push_str ( & format ! (
422+ "- Clear: `cache_operations({{task_id: \" {}\" , clear: true}})`\n " ,
423+ task. task_id
424+ ) ) ;
389425 }
390426 TaskStatus :: Failed => {
391- output. push_str ( & format ! ( "**Duration**: {} \n " , format_duration( task. elapsed_secs( ) ) ) ) ;
427+ output. push_str ( & format ! (
428+ "**Duration**: {} \n " ,
429+ format_duration( task. elapsed_secs( ) )
430+ ) ) ;
392431 if let Some ( error) = & task. error {
393432 // Truncate long errors for list view
394433 let error_preview = if error. len ( ) > 100 {
@@ -399,14 +438,29 @@ fn format_task_summary(task: &CachingTask) -> String {
399438 output. push_str ( & format ! ( "**Error**: {}\n \n " , error_preview) ) ;
400439 }
401440 output. push_str ( "**Actions**:\n " ) ;
402- output. push_str ( & format ! ( "- View details: `cache_operations({{task_id: \" {}\" }})`\n " , task. task_id) ) ;
403- output. push_str ( & format ! ( "- Clear: `cache_operations({{task_id: \" {}\" , clear: true}})`\n " , task. task_id) ) ;
441+ output. push_str ( & format ! (
442+ "- View details: `cache_operations({{task_id: \" {}\" }})`\n " ,
443+ task. task_id
444+ ) ) ;
445+ output. push_str ( & format ! (
446+ "- Clear: `cache_operations({{task_id: \" {}\" , clear: true}})`\n " ,
447+ task. task_id
448+ ) ) ;
404449 }
405450 TaskStatus :: Cancelled => {
406- output. push_str ( & format ! ( "**Duration**: {} \n " , format_duration( task. elapsed_secs( ) ) ) ) ;
407- output. push_str ( & format ! ( "**Cancelled**: {}\n \n " , format_timestamp( task. completed_at. unwrap_or( task. started_at) ) ) ) ;
451+ output. push_str ( & format ! (
452+ "**Duration**: {} \n " ,
453+ format_duration( task. elapsed_secs( ) )
454+ ) ) ;
455+ output. push_str ( & format ! (
456+ "**Cancelled**: {}\n \n " ,
457+ format_timestamp( task. completed_at. unwrap_or( task. started_at) )
458+ ) ) ;
408459 output. push_str ( "**Actions**:\n " ) ;
409- output. push_str ( & format ! ( "- Clear: `cache_operations({{task_id: \" {}\" , clear: true}})`\n " , task. task_id) ) ;
460+ output. push_str ( & format ! (
461+ "- Clear: `cache_operations({{task_id: \" {}\" , clear: true}})`\n " ,
462+ task. task_id
463+ ) ) ;
410464 }
411465 }
412466
@@ -434,7 +488,10 @@ pub fn format_clear_result(tasks: Vec<CachingTask>) -> String {
434488 }
435489
436490 let mut output = String :: from ( "# Tasks Cleared\n \n " ) ;
437- output. push_str ( & format ! ( "Successfully cleared {} task(s) from memory:\n \n " , tasks. len( ) ) ) ;
491+ output. push_str ( & format ! (
492+ "Successfully cleared {} task(s) from memory:\n \n " ,
493+ tasks. len( )
494+ ) ) ;
438495
439496 for task in tasks {
440497 let status_str = match task. status {
0 commit comments