From 74a80000b3251148ac6a94cd6b43804c7a1f38a5 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 27 Dec 2024 22:38:44 +0100 Subject: feat(back/src/issues/issue): implement Display for Author MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Silas Schöffel --- pkgs/by-name/ba/back/src/git_bug/issue/identity/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/ba/back/src/git_bug/issue/identity/mod.rs b/pkgs/by-name/ba/back/src/git_bug/issue/identity/mod.rs index 0c2f426..bbf483c 100644 --- a/pkgs/by-name/ba/back/src/git_bug/issue/identity/mod.rs +++ b/pkgs/by-name/ba/back/src/git_bug/issue/identity/mod.rs @@ -9,6 +9,8 @@ // You should have received a copy of the License along with this program. // If not, see . +use std::fmt::Display; + use gix::{bstr::ByteSlice, Repository}; use serde::Deserialize; use serde_json::Value; @@ -24,6 +26,12 @@ pub struct Author { pub id: Id, } +impl Display for Author { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "({}, {})", self.name, self.email) + } +} + impl Author { pub fn construct(repo: &Repository, raw: RawAuthor) -> Self { let commit_obj = repo -- cgit 1.4.1