index: remove num_commits() from API

This commit is contained in:
Martin von Zweigbergk 2023-03-12 11:17:33 -07:00 committed by Martin von Zweigbergk
parent 0a7de2540f
commit 74ffe7f688
2 changed files with 8 additions and 10 deletions

View file

@ -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<IndexPosition> {
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<IndexPosition> {
CompositeIndex(self).commit_id_to_pos(commit_id)
}

View file

@ -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<IndexPosition>;
fn shortest_unique_commit_id_prefix_len(&self, commit_id: &CommitId) -> usize;