summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-27 22:38:44 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-27 22:38:44 +0100
commit74a80000b3251148ac6a94cd6b43804c7a1f38a5 (patch)
tree9df72eaf811b22dfba82d58c4cfd050bfa700a9c
parentfix(server2/networking): correct ipv6 address (diff)
downloadnixos-server-74a80000b3251148ac6a94cd6b43804c7a1f38a5.zip
feat(back/src/issues/issue): implement Display for Author
Co-authored-by: Silas Schöffel <sils@sils.li>
-rw-r--r--pkgs/by-name/ba/back/src/git_bug/issue/identity/mod.rs8
1 files changed, 8 insertions, 0 deletions
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 <https://www.gnu.org/licenses/agpl.txt>.
 
+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