From 4df747a4938f064f6049ce47a68c64fbd1a71ffb Mon Sep 17 00:00:00 2001 From: Brian H Date: Fri, 12 Jul 2024 13:59:58 -0600 Subject: [PATCH] Make Label and PackageRef Ord and PartialOrd Signed-off-by: Brian H --- crates/wasm-pkg-common/src/label.rs | 2 +- crates/wasm-pkg-common/src/package.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/wasm-pkg-common/src/label.rs b/crates/wasm-pkg-common/src/label.rs index 637cbef..7aa733c 100644 --- a/crates/wasm-pkg-common/src/label.rs +++ b/crates/wasm-pkg-common/src/label.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; /// A Component Model kebab-case label. -#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] #[serde(into = "String", try_from = "String")] pub struct Label(String); diff --git a/crates/wasm-pkg-common/src/package.rs b/crates/wasm-pkg-common/src/package.rs index 267a661..be7d8da 100644 --- a/crates/wasm-pkg-common/src/package.rs +++ b/crates/wasm-pkg-common/src/package.rs @@ -9,7 +9,7 @@ pub use semver::Version; /// A package reference, consisting of kebab-case namespace and name. /// /// Ex: `wasm-pkg:client` -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] #[serde(into = "String", try_from = "String")] pub struct PackageRef { namespace: Label,