diff --git a/git-trailers/Cargo.toml b/git-trailers/Cargo.toml index 937553a..7316b8b 100644 --- a/git-trailers/Cargo.toml +++ b/git-trailers/Cargo.toml @@ -1,9 +1,15 @@ [package] name = "git-trailers" version = "0.1.0" -authors = ["Nuno Alexandre ", "Kim Altintop "] +authors = [ + "Nuno Alexandre ", + "Kim Altintop ", + "Fintan Halpenny ", +] edition = "2018" license = "GPL-3.0-or-later" +description = "Library to support parsing and display git trailers " +keywords = ["git"] [lib] doctest = false diff --git a/git-trailers/src/lib.rs b/git-trailers/src/lib.rs index d14dbf6..b982396 100644 --- a/git-trailers/src/lib.rs +++ b/git-trailers/src/lib.rs @@ -45,11 +45,13 @@ pub struct Token<'a>(&'a str); /// A version of the Trailer<'a> which owns it's token and values. Useful for /// when you need to carry trailers around in a long lived data structure. +#[derive(Debug)] pub struct OwnedTrailer { - token: OwnedToken, - values: Vec, + pub token: OwnedToken, + pub values: Vec, } +#[derive(Debug)] pub struct OwnedToken(String); impl<'a> From<&Trailer<'a>> for OwnedTrailer { @@ -76,6 +78,14 @@ impl<'a> From<&'a OwnedTrailer> for Trailer<'a> { } } +impl Deref for OwnedToken { + type Target = str; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + #[derive(Debug, Error)] #[non_exhaustive] pub enum InvalidToken {