Skip to content

Commit

Permalink
chore: impl ord/partialord for Component
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts committed Oct 28, 2024
1 parent c6a012e commit 339d5ae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ impl<T> PartialEq for Component<T> {
}
}

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

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

impl<T> Copy for Component<T> {}

impl<T> Clone for Component<T> {
Expand Down

0 comments on commit 339d5ae

Please sign in to comment.