diff --git a/lib/src/default_index_store.rs b/lib/src/default_index_store.rs index 4e5db7cac..29297256d 100644 --- a/lib/src/default_index_store.rs +++ b/lib/src/default_index_store.rs @@ -679,6 +679,10 @@ impl MutableIndexImpl { pub fn stats(&self) -> IndexStats { CompositeIndex(self).stats() } + + pub fn num_commits(&self) -> u32 { + CompositeIndex(self).num_commits() + } } impl Index for MutableIndexImpl { @@ -686,10 +690,6 @@ impl Index for MutableIndexImpl { self } - fn num_commits(&self) -> u32 { - CompositeIndex(self).num_commits() - } - fn commit_id_to_pos(&self, commit_id: &CommitId) -> Option { CompositeIndex(self).commit_id_to_pos(commit_id) } @@ -1752,6 +1752,10 @@ impl ReadonlyIndexImpl { pub fn stats(&self) -> IndexStats { CompositeIndex(self).stats() } + + pub fn num_commits(&self) -> u32 { + CompositeIndex(self).num_commits() + } } impl Index for ReadonlyIndexImpl { @@ -1759,10 +1763,6 @@ impl Index for ReadonlyIndexImpl { self } - fn num_commits(&self) -> u32 { - CompositeIndex(self).num_commits() - } - fn commit_id_to_pos(&self, commit_id: &CommitId) -> Option { CompositeIndex(self).commit_id_to_pos(commit_id) } diff --git a/lib/src/index.rs b/lib/src/index.rs index dc1ad91d7..ce6fb0c58 100644 --- a/lib/src/index.rs +++ b/lib/src/index.rs @@ -48,8 +48,6 @@ pub trait IndexStore: Send + Sync + Debug { pub trait Index { fn as_any(&self) -> &dyn Any; - fn num_commits(&self) -> u32; - fn commit_id_to_pos(&self, commit_id: &CommitId) -> Option; fn shortest_unique_commit_id_prefix_len(&self, commit_id: &CommitId) -> usize;