Skip to content

Commit ac86c81

Browse files
but-hunk-assignment: clarify ret. type of hunk_dependency_assignments
This function never returns `Error`, so remove `Return` from its return type. (This function was made to never return `Error` in a7569ab (Return dependency information from `changes_in_worktree`, 2025-06-24).) This helps analysis of the situations in which its callers can return `Error`. This analysis will be done in a subsequent commit.
1 parent 4d873b2 commit ac86c81

File tree

1 file changed

+4
-4
lines changed
  • crates/but-hunk-assignment/src

1 file changed

+4
-4
lines changed

crates/but-hunk-assignment/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ pub fn assign(
287287
);
288288

289289
// Reconcile with hunk locks
290-
let lock_assignments = hunk_dependency_assignments(deps)?;
290+
let lock_assignments = hunk_dependency_assignments(deps);
291291
let with_locks = reconcile::assignments(
292292
&with_requests,
293293
&lock_assignments,
@@ -412,7 +412,7 @@ fn reconcile_with_worktree_and_locks(
412412
true,
413413
);
414414

415-
let lock_assignments = hunk_dependency_assignments(deps)?;
415+
let lock_assignments = hunk_dependency_assignments(deps);
416416
let with_locks = reconcile::assignments(
417417
&with_worktree,
418418
&lock_assignments,
@@ -424,7 +424,7 @@ fn reconcile_with_worktree_and_locks(
424424
Ok(with_locks)
425425
}
426426

427-
fn hunk_dependency_assignments(deps: &HunkDependencies) -> Result<Vec<HunkAssignment>> {
427+
fn hunk_dependency_assignments(deps: &HunkDependencies) -> Vec<HunkAssignment> {
428428
let mut assignments = vec![];
429429
for (path, hunk, locks) in &deps.diffs {
430430
// If there are locks towards more than one stack, this means double locking and the assignment None - the user can resolve this by partial committing.
@@ -451,7 +451,7 @@ fn hunk_dependency_assignments(deps: &HunkDependencies) -> Result<Vec<HunkAssign
451451
};
452452
assignments.push(assignment);
453453
}
454-
Ok(assignments)
454+
assignments
455455
}
456456

457457
/// This also generates a UUID for the assignment

0 commit comments

Comments
 (0)