Skip to content

Commit 40710a2

Browse files
arlosiTurbo87
authored andcommitted
index: Implement Ord and Eq for Dependency
This allows us to `.sort()` the list of dependencies.
1 parent 9ca8104 commit 40710a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cargo-registry-index/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub struct Crate {
139139
pub v: Option<u32>,
140140
}
141141

142-
#[derive(Serialize, Deserialize, Debug)]
142+
#[derive(Serialize, Deserialize, Debug, PartialEq, PartialOrd, Ord, Eq)]
143143
pub struct Dependency {
144144
pub name: String,
145145
pub req: String,
@@ -152,7 +152,7 @@ pub struct Dependency {
152152
pub package: Option<String>,
153153
}
154154

155-
#[derive(Copy, Clone, Serialize, Deserialize, Debug)]
155+
#[derive(Copy, Clone, Serialize, Deserialize, Debug, PartialEq, PartialOrd, Ord, Eq)]
156156
#[serde(rename_all = "lowercase")]
157157
pub enum DependencyKind {
158158
Normal,

0 commit comments

Comments
 (0)