issue.rs: add fmt::Display for State

This commit is contained in:
sigil-03 2025-07-07 13:07:55 -06:00
parent ed1b4488b2
commit a6d2f7d1e8

View file

@ -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<Self, IssueError> {
let mut description: Option<String> = None;