From 6f0beed9c2219268807b9a7302ec374431624043 Mon Sep 17 00:00:00 2001 From: tilpner Date: Thu, 28 May 2020 19:34:05 +0200 Subject: atom: add state, other labels, update time, author --- src/query/issues.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/query') diff --git a/src/query/issues.rs b/src/query/issues.rs index c829a22..b9473d3 100644 --- a/src/query/issues.rs +++ b/src/query/issues.rs @@ -30,6 +30,14 @@ fn state_to_integer(state: issues_query::IssueState) -> i64 { } } +pub fn integer_to_state_desc(state: i64) -> Option { + match state { + 0 => Some("open"), + 1 => Some("closed"), + _ => None + }.map(str::to_owned) +} + pub async fn update(mut conn: &mut Conn, github_api_token: &str, (ref owner, ref name): (String, String)) -> anyhow::Result<()> { let repo = repo_id(conn, owner, name).await?; -- cgit v1.2.3