mirror of
https://github.com/martinvonz/jj.git
synced 2024-09-11 13:56:29 +03:00
index: remove num_commits() from API
This commit is contained in:
parent
0a7de2540f
commit
74ffe7f688
@ -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)
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user