From 65a6353f0636da5bc6d3c2de7a7a66e051234cd2 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sat, 11 Mar 2023 13:17:38 -0800 Subject: [PATCH] index: stop implementing Index trait on wrapper type Since `ReadonlyIndex` and `Index` are different types, we don't need to implement `Index` on `ReadonlyIndexWrapper`. --- lib/src/default_index_store.rs | 54 ---------------------------------- 1 file changed, 54 deletions(-) diff --git a/lib/src/default_index_store.rs b/lib/src/default_index_store.rs index 5fd932c33..4187009f8 100644 --- a/lib/src/default_index_store.rs +++ b/lib/src/default_index_store.rs @@ -1770,60 +1770,6 @@ impl Index for ReadonlyIndexImpl { } } -impl Index for ReadonlyIndexWrapper { - fn num_commits(&self) -> u32 { - self.0.num_commits() - } - - fn stats(&self) -> IndexStats { - self.0.stats() - } - - fn commit_id_to_pos(&self, commit_id: &CommitId) -> Option { - self.0.commit_id_to_pos(commit_id) - } - - fn shortest_unique_commit_id_prefix_len(&self, commit_id: &CommitId) -> usize { - self.0.shortest_unique_commit_id_prefix_len(commit_id) - } - - fn resolve_prefix(&self, prefix: &HexPrefix) -> PrefixResolution { - self.0.resolve_prefix(prefix) - } - - fn entry_by_id(&self, commit_id: &CommitId) -> Option { - self.0.entry_by_id(commit_id) - } - - fn entry_by_pos(&self, pos: IndexPosition) -> IndexEntry { - self.0.entry_by_pos(pos) - } - - fn has_id(&self, commit_id: &CommitId) -> bool { - self.0.has_id(commit_id) - } - - fn is_ancestor(&self, ancestor_id: &CommitId, descendant_id: &CommitId) -> bool { - self.0.is_ancestor(ancestor_id, descendant_id) - } - - fn common_ancestors(&self, set1: &[CommitId], set2: &[CommitId]) -> Vec { - self.0.common_ancestors(set1, set2) - } - - fn walk_revs(&self, wanted: &[CommitId], unwanted: &[CommitId]) -> RevWalk { - self.0.walk_revs(wanted, unwanted) - } - - fn heads(&self, candidates: &mut dyn Iterator) -> Vec { - self.0.heads(candidates) - } - - fn topo_order(&self, input: &mut dyn Iterator) -> Vec { - self.0.topo_order(input) - } -} - #[cfg(test)] mod tests { use test_case::test_case;