Skip to content

Commit

Permalink
index: hide walk_revs() and related types
Browse files Browse the repository at this point in the history
They are now implementation details of the default index backend.
  • Loading branch information
yuja committed Mar 7, 2024
1 parent c7557d5 commit aecb68f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 5 additions & 1 deletion lib/src/default_index/composite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ impl<'a> CompositeIndex<'a> {
self.heads_pos(result)
}

pub fn walk_revs(&self, wanted: &[IndexPosition], unwanted: &[IndexPosition]) -> RevWalk<'a> {
pub(super) fn walk_revs(
&self,
wanted: &[IndexPosition],
unwanted: &[IndexPosition],
) -> RevWalk<'a> {
let mut rev_walk = RevWalk::new(*self);
rev_walk.extend_wanted(wanted.iter().copied());
rev_walk.extend_unwanted(unwanted.iter().copied());
Expand Down
3 changes: 0 additions & 3 deletions lib/src/default_index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ pub use self::composite::{AsCompositeIndex, CompositeIndex, IndexLevelStats, Ind
pub use self::entry::{IndexEntry, IndexPosition};
pub use self::mutable::DefaultMutableIndex;
pub use self::readonly::{DefaultReadonlyIndex, ReadonlyIndexLoadError};
pub use self::rev_walk::{
RevWalk, RevWalkDescendants, RevWalkDescendantsGenerationRange, RevWalkGenerationRange,
};
pub use self::store::{DefaultIndexStore, DefaultIndexStoreError, DefaultIndexStoreInitError};

#[cfg(test)]
Expand Down
8 changes: 4 additions & 4 deletions lib/src/default_index/rev_walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl<P: Ord, T: Ord> RevWalkQueue<P, T> {
}

#[derive(Clone)]
pub struct RevWalk<'a>(RevWalkImpl<'a, CompositeIndex<'a>>);
pub(super) struct RevWalk<'a>(RevWalkImpl<'a, CompositeIndex<'a>>);

impl<'a> RevWalk<'a> {
pub(super) fn new(index: CompositeIndex<'a>) -> Self {
Expand Down Expand Up @@ -326,7 +326,7 @@ impl<'a, I: RevWalkIndex<'a>> RevWalkImpl<'a, I> {
}

#[derive(Clone)]
pub struct RevWalkGenerationRange<'a>(RevWalkGenerationRangeImpl<'a, CompositeIndex<'a>>);
pub(super) struct RevWalkGenerationRange<'a>(RevWalkGenerationRangeImpl<'a, CompositeIndex<'a>>);

impl<'a> Iterator for RevWalkGenerationRange<'a> {
type Item = IndexEntry<'a>;
Expand All @@ -337,7 +337,7 @@ impl<'a> Iterator for RevWalkGenerationRange<'a> {
}

#[derive(Clone)]
pub struct RevWalkDescendantsGenerationRange<'a>(
pub(super) struct RevWalkDescendantsGenerationRange<'a>(
RevWalkGenerationRangeImpl<'a, RevWalkDescendantsIndex<'a>>,
);

Expand Down Expand Up @@ -465,7 +465,7 @@ impl RevWalkItemGenerationRange {

/// Walks descendants from the roots, in order of ascending index position.
#[derive(Clone)]
pub struct RevWalkDescendants<'a> {
pub(super) struct RevWalkDescendants<'a> {
candidate_entries: Vec<IndexEntry<'a>>,
root_positions: HashSet<IndexPosition>,
reachable_positions: HashSet<IndexPosition>,
Expand Down

0 comments on commit aecb68f

Please sign in to comment.