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:
parent
0e45347b92
commit
60871de89d
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -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`].
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue