From 9927a9856ec3fdf17335f93e705f42db936a4b34 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Thu, 17 Oct 2024 08:22:07 +0800 Subject: [PATCH] rewrite: make `MoveCommitStats` derive `Default` --- lib/src/rewrite.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/src/rewrite.rs b/lib/src/rewrite.rs index 6ff73ff1f..c02a4cdce 100644 --- a/lib/src/rewrite.rs +++ b/lib/src/rewrite.rs @@ -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 { 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();