use {
super::bline::BLine,
id_arena::Id,
std::cmp::Ordering,
};
pub type BId = Id<BLine>;
pub struct SortableBId {
pub id: BId,
pub score: i32,
}
impl Eq for SortableBId {}
impl PartialEq for SortableBId {
fn eq(
&self,
other: &SortableBId,
) -> bool {
self.score == other.score }
}
impl Ord for SortableBId {
fn cmp(
&self,
other: &SortableBId,
) -> Ordering {
other.score.cmp(&self.score)
}
}
impl PartialOrd for SortableBId {
fn partial_cmp(
&self,
other: &SortableBId,
) -> Option<Ordering> {
Some(self.cmp(other))
}
}