summaryrefslogtreecommitdiff
path: root/shared/src/packets.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-03-24 14:12:06 +0100
committermetamuffin <metamuffin@disroot.org>2025-03-24 14:12:06 +0100
commitd48ff95ec3739b8179b0e0f5b07d5c89f8f5b33f (patch)
treecaf5cd76df370b6099d8de5005fee795dcb0147b /shared/src/packets.rs
parentf8c243d5a06cbb72f4757e2fb5421c3ec50d509c (diff)
downloadweareserver-d48ff95ec3739b8179b0e0f5b07d5c89f8f5b33f.tar
weareserver-d48ff95ec3739b8179b0e0f5b07d5c89f8f5b33f.tar.bz2
weareserver-d48ff95ec3739b8179b0e0f5b07d5c89f8f5b33f.tar.zst
impl Ord for Resource
Diffstat (limited to 'shared/src/packets.rs')
-rw-r--r--shared/src/packets.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/shared/src/packets.rs b/shared/src/packets.rs
index f44a953..11b5f8a 100644
--- a/shared/src/packets.rs
+++ b/shared/src/packets.rs
@@ -41,6 +41,16 @@ impl<T> Hash for Resource<T> {
self.0.hash(state);
}
}
+impl<T> PartialOrd for Resource<T> {
+ fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
+ Some(self.cmp(other))
+ }
+}
+impl<T> Ord for Resource<T> {
+ fn cmp(&self, other: &Self) -> std::cmp::Ordering {
+ self.0.cmp(&other.0)
+ }
+}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Object(pub u128);