From a6d2f7d1e83a0f86fd52324b73417925c27d8fc1 Mon Sep 17 00:00:00 2001 From: sigil-03 Date: Mon, 7 Jul 2025 13:07:55 -0600 Subject: [PATCH] issue.rs: add fmt::Display for State --- src/issue.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/issue.rs b/src/issue.rs index d3ecf3d..61f7072 100644 --- a/src/issue.rs +++ b/src/issue.rs @@ -1,3 +1,4 @@ +use core::fmt; use std::io::Write; use std::str::FromStr; @@ -62,6 +63,21 @@ impl FromStr for State { } } +impl fmt::Display for State { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let fmt_str = match self { + State::New => "new", + State::Backlog => "backlog", + State::Blocked => "blocked", + State::InProgress => "inprogress", + State::Done => "done", + State::WontDo => "wontdo", + + }; + write!(f, "{fmt_str}") + } +} + impl Issue { pub fn new_from_dir(dir: &std::path::Path) -> Result { let mut description: Option = None;