@@ -144,17 +144,19 @@ pub fn apply_mapreduce_progress(info: &mut EnhancedSessionInfo, progress: &MapRe
144144/// * `WorktreeSummary` - Aggregated summary statistics
145145#[ must_use]
146146pub fn calculate_summary ( sessions : & [ EnhancedSessionInfo ] ) -> WorktreeSummary {
147- sessions. iter ( ) . fold ( WorktreeSummary :: default ( ) , |mut summary, session| {
148- summary. total += 1 ;
149- match session. status {
150- WorktreeStatus :: InProgress => summary. in_progress += 1 ,
151- WorktreeStatus :: Interrupted => summary. interrupted += 1 ,
152- WorktreeStatus :: Failed => summary. failed += 1 ,
153- WorktreeStatus :: Completed | WorktreeStatus :: Merged => summary. completed += 1 ,
154- WorktreeStatus :: CleanedUp | WorktreeStatus :: Abandoned => { }
155- }
156- summary
157- } )
147+ sessions
148+ . iter ( )
149+ . fold ( WorktreeSummary :: default ( ) , |mut summary, session| {
150+ summary. total += 1 ;
151+ match session. status {
152+ WorktreeStatus :: InProgress => summary. in_progress += 1 ,
153+ WorktreeStatus :: Interrupted => summary. interrupted += 1 ,
154+ WorktreeStatus :: Failed => summary. failed += 1 ,
155+ WorktreeStatus :: Completed | WorktreeStatus :: Merged => summary. completed += 1 ,
156+ WorktreeStatus :: CleanedUp | WorktreeStatus :: Abandoned => { }
157+ }
158+ summary
159+ } )
158160}
159161
160162/// Sort sessions by last activity (most recent first)
@@ -184,7 +186,10 @@ mod tests {
184186
185187 let info = extract_workflow_info ( & session_state) ;
186188
187- assert_eq ! ( info. workflow_path, Some ( PathBuf :: from( "/path/to/workflow.yaml" ) ) ) ;
189+ assert_eq ! (
190+ info. workflow_path,
191+ Some ( PathBuf :: from( "/path/to/workflow.yaml" ) )
192+ ) ;
188193 assert_eq ! ( info. workflow_args, vec![ "arg1" , "arg2" , "arg3" ] ) ;
189194 assert_eq ! ( info. current_step, 5 ) ;
190195 assert_eq ! ( info. total_steps, Some ( 10 ) ) ;
0 commit comments