aboutsummaryrefslogtreecommitdiff
path: root/src/query
diff options
context:
space:
mode:
Diffstat (limited to 'src/query')
-rw-r--r--src/query/issues.rs8
1 files changed, 8 insertions, 0 deletions
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<String> {
+ 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?;