Skip to content

Commit d7360c5

Browse files
committed
style: Format code with cargo fmt
1 parent 69f868c commit d7360c5

3 files changed

Lines changed: 28 additions & 23 deletions

File tree

‎src/cli/commands/resume.rs‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,12 @@ async fn read_workflow_path_from_checkpoint(
218218
checkpoint_file: &Path,
219219
session_id: &str,
220220
) -> Result<String> {
221-
let checkpoint_json = fs::read_to_string(checkpoint_file)
222-
.await
223-
.with_context(|| {
224-
format!(
225-
"Failed to read checkpoint file: {}",
226-
checkpoint_file.display()
227-
)
228-
})?;
221+
let checkpoint_json = fs::read_to_string(checkpoint_file).await.with_context(|| {
222+
format!(
223+
"Failed to read checkpoint file: {}",
224+
checkpoint_file.display()
225+
)
226+
})?;
229227

230228
let checkpoint: serde_json::Value =
231229
serde_json::from_str(&checkpoint_json).context("Failed to parse checkpoint JSON")?;
@@ -496,8 +494,7 @@ async fn try_resume_regular_workflow(
496494
}
497495

498496
// Find the checkpoint file
499-
let checkpoint_file =
500-
find_checkpoint_file(&checkpoint_dir, from_checkpoint.as_deref()).await?;
497+
let checkpoint_file = find_checkpoint_file(&checkpoint_dir, from_checkpoint.as_deref()).await?;
501498

502499
// Extract workflow path from checkpoint
503500
let workflow_path = read_workflow_path_from_checkpoint(&checkpoint_file, session_id).await?;

‎src/worktree/list_detailed_pure.rs‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,19 @@ pub fn apply_mapreduce_progress(info: &mut EnhancedSessionInfo, progress: &MapRe
144144
/// * `WorktreeSummary` - Aggregated summary statistics
145145
#[must_use]
146146
pub 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));

‎src/worktree/manager.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ impl WorktreeManager {
279279
///
280280
/// # Returns
281281
/// * `Option<Value>` - The parsed JSON, or None if not found/invalid
282-
fn load_session_state_json(&self, worktree_path: &std::path::Path) -> Option<serde_json::Value> {
282+
fn load_session_state_json(
283+
&self,
284+
worktree_path: &std::path::Path,
285+
) -> Option<serde_json::Value> {
283286
let session_state_path = worktree_path.join(".prodigy").join("session_state.json");
284287

285288
std::fs::read_to_string(&session_state_path)

0 commit comments

Comments
 (0)