From d48ff95ec3739b8179b0e0f5b07d5c89f8f5b33f Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 24 Mar 2025 14:12:06 +0100 Subject: impl Ord for Resource --- shared/src/packets.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'shared/src/packets.rs') 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 Hash for Resource { self.0.hash(state); } } +impl PartialOrd for Resource { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} +impl Ord for Resource { + 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); -- cgit v1.2.3-70-g09d2