Skip to content

Commit

Permalink
Merge pull request #577 from epage/ord
Browse files Browse the repository at this point in the history
feat(stream): Make Checkpoints comparable
  • Loading branch information
epage authored Jul 31, 2024
2 parents 103d9e7 + 4ff0f9c commit e746a0f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2775,6 +2775,26 @@ impl<T: Clone, S> Clone for Checkpoint<T, S> {
}
}

impl<T: PartialOrd, S> PartialOrd for Checkpoint<T, S> {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
self.inner.partial_cmp(&other.inner)
}
}

impl<T: Ord, S> Ord for Checkpoint<T, S> {
fn cmp(&self, other: &Self) -> core::cmp::Ordering {
self.inner.cmp(&other.inner)
}
}

impl<T: PartialEq, S> PartialEq for Checkpoint<T, S> {
fn eq(&self, other: &Self) -> bool {
self.inner.eq(&other.inner)
}
}

impl<T: Eq, S> Eq for Checkpoint<T, S> {}

impl<T: crate::lib::std::fmt::Debug, S> crate::lib::std::fmt::Debug for Checkpoint<T, S> {
fn fmt(&self, f: &mut crate::lib::std::fmt::Formatter<'_>) -> crate::lib::std::fmt::Result {
self.inner.fmt(f)
Expand Down

0 comments on commit e746a0f

Please sign in to comment.