From 277b81ff6fe646e337f02ac71a5d33d1d9c99c57 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Fri, 22 Dec 2023 17:35:56 -0800 Subject: [PATCH] lib: make `DescendantRebaser`-related APIs private. Finally, there are no test uses of these APIs. `DescendantRebaser` is made `pub(crate)`, since it is used by `MutRepo`. Other functions are made private. --- lib/src/repo.rs | 2 +- lib/src/rewrite.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/repo.rs b/lib/src/repo.rs index 5894ece83..b1f09022d 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -885,7 +885,7 @@ impl MutableRepo { /// Creates a `DescendantRebaser` to rebase descendants of the recorded /// rewritten and abandoned commits. // TODO(ilyagr): Inline this. It's only used in tests. - pub fn create_descendant_rebaser<'settings, 'repo>( + fn create_descendant_rebaser<'settings, 'repo>( &'repo mut self, settings: &'settings UserSettings, ) -> DescendantRebaser<'settings, 'repo> { diff --git a/lib/src/rewrite.rs b/lib/src/rewrite.rs index e179fb29d..d2bccc89b 100644 --- a/lib/src/rewrite.rs +++ b/lib/src/rewrite.rs @@ -242,7 +242,7 @@ pub struct RebaseOptions { } /// Rebases descendants of a commit onto a new commit (or several). -pub struct DescendantRebaser<'settings, 'repo> { +pub(crate) struct DescendantRebaser<'settings, 'repo> { settings: &'settings UserSettings, mut_repo: &'repo mut MutableRepo, // The commit identified by the key has been replaced by all the ones in the value, typically @@ -521,7 +521,7 @@ impl<'settings, 'repo> DescendantRebaser<'settings, 'repo> { // TODO: Perhaps change the interface since it's not just about rebasing // commits. - pub fn rebase_next(&mut self) -> Result, TreeMergeError> { + fn rebase_next(&mut self) -> Result, TreeMergeError> { while let Some(old_commit) = self.to_visit.pop() { let old_commit_id = old_commit.id().clone(); if let Some(new_parent_ids) = self.parent_mapping.get(&old_commit_id).cloned() {