Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
git-metadata: Add derivable traits
Fintan Halpenny committed 1 month ago
commit 60871de89dda1b18fadb2ce5a2177c6c22e0ffac
parent 0e45347
3 files changed +4 -4
modified crates/radicle-git-metadata/src/commit.rs
@@ -11,7 +11,7 @@ use crate::author::Author;

/// A git commit in its object description form, i.e. the output of
/// `git cat-file` for a commit object.
-
#[derive(Debug)]
+
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct CommitData<Tree, Parent> {
    tree: Tree,
    parents: Vec<Parent>,
modified crates/radicle-git-metadata/src/commit/headers.rs
@@ -7,7 +7,7 @@ const BEGIN_PGP: &str = "-----BEGIN PGP SIGNATURE-----\n";
/// A collection of headers stored in [`super::CommitData`].
///
/// Note: these do not include `tree`, `parent`, `author`, and `committer`.
-
#[derive(Clone, Debug, Default)]
+
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct Headers(pub(super) Vec<(String, String)>);

/// A `gpgsig` signature stored in [`super::CommitData`].
modified crates/radicle-git-metadata/src/commit/trailers.rs
@@ -85,13 +85,13 @@ impl<'a> Trailer<'a> {
/// A version of the [`Trailer`] which owns its token and
/// value. Useful for when you need to carry trailers around in a long
/// lived data structure.
-
#[derive(Debug)]
+
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct OwnedTrailer {
    pub token: OwnedToken,
    pub value: String,
}

-
#[derive(Debug)]
+
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct OwnedToken(String);

impl Deref for OwnedToken {