Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revset: remove 'index lifetime from InternalRevset #2700

Merged
merged 7 commits into from
Dec 15, 2023
16 changes: 0 additions & 16 deletions lib/src/default_index/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#![allow(missing_docs)]

use std::cmp::Ordering;
use std::fmt::{Debug, Formatter};
use std::hash::{Hash, Hasher};

Expand Down Expand Up @@ -107,21 +106,6 @@ impl<'a> IndexEntry<'a> {
}
}

#[derive(Clone, Eq, PartialEq)]
pub struct IndexEntryByPosition<'a>(pub IndexEntry<'a>);

impl Ord for IndexEntryByPosition<'_> {
fn cmp(&self, other: &Self) -> Ordering {
self.0.pos.cmp(&other.0.pos)
}
}

impl PartialOrd for IndexEntryByPosition<'_> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

/// Wrapper to sort `IndexPosition` by its generation number.
///
/// This is similar to `IndexEntry` newtypes, but optimized for size and cache
Expand Down
2 changes: 1 addition & 1 deletion lib/src/default_index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mod rev_walk;
mod store;

pub use self::composite::{CompositeIndex, IndexLevelStats, IndexStats};
pub use self::entry::{IndexEntry, IndexEntryByPosition, IndexPosition};
pub use self::entry::{IndexEntry, IndexPosition};
pub use self::mutable::DefaultMutableIndex;
pub use self::readonly::DefaultReadonlyIndex;
pub use self::rev_walk::{
Expand Down
Loading