git-metadata: Add derivable traits

Add more derivable traits to structs in `radicle-git-metadata` types to
make them easier to use.
This commit is contained in:
Fintan Halpenny 2026-02-19 13:48:31 +00:00 committed by Lorenz Leutgeb
parent 0e45347b92
commit 60871de89d
3 changed files with 4 additions and 4 deletions

View File

@ -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>,

View File

@ -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`].

View File

@ -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 {