rewrite: make MoveCommitStats derive Default

This commit is contained in:
Benjamin Tan 2024-10-17 08:22:07 +08:00
parent 5bd55f2981
commit 9927a9856e

View file

@ -459,6 +459,7 @@ impl<'settings, 'repo> DescendantRebaser<'settings, 'repo> {
}
}
#[derive(Default)]
pub struct MoveCommitsStats {
/// The number of commits in the target set which were rebased.
pub num_rebased_targets: u32,
@ -493,12 +494,7 @@ pub fn move_commits(
options: &RebaseOptions,
) -> BackendResult<MoveCommitsStats> {
if target_commits.is_empty() {
return Ok(MoveCommitsStats {
num_rebased_targets: 0,
num_rebased_descendants: 0,
num_skipped_rebases: 0,
num_abandoned: 0,
});
return Ok(MoveCommitsStats::default());
}
let target_commit_ids: HashSet<_> = target_commits.iter().ids().cloned().collect();