From 7347d031e7dd32b0e03db704a062c9d300bde168 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Thu, 4 Jul 2024 15:21:10 +0200 Subject: [PATCH] http: Rename `IssueState` and `PatchState` to `IssueStatus` and `PatchState` --- radicle-httpd/src/api.rs | 8 ++++---- radicle-httpd/src/api/v1/projects.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/radicle-httpd/src/api.rs b/radicle-httpd/src/api.rs index 56883dad9..a3a0ef21d 100644 --- a/radicle-httpd/src/api.rs +++ b/radicle-httpd/src/api.rs @@ -173,14 +173,14 @@ pub struct PoliciesQuery { #[derive(Default, Serialize, Deserialize, Clone)] #[serde(rename_all = "camelCase")] -pub enum IssueState { +pub enum IssueStatus { Closed, #[default] Open, All, } -impl IssueState { +impl IssueStatus { pub fn matches(&self, issue: &issue::State) -> bool { match self { Self::Open => matches!(issue, issue::State::Open), @@ -192,7 +192,7 @@ impl IssueState { #[derive(Default, Serialize, Deserialize, Clone)] #[serde(rename_all = "camelCase")] -pub enum PatchState { +pub enum PatchStatus { #[default] Open, Draft, @@ -201,7 +201,7 @@ pub enum PatchState { All, } -impl PatchState { +impl PatchStatus { pub fn matches(&self, patch: &patch::State) -> bool { match self { Self::Open => matches!(patch, patch::State::Open { .. }), diff --git a/radicle-httpd/src/api/v1/projects.rs b/radicle-httpd/src/api/v1/projects.rs index f5ca00e92..7f372c6a2 100644 --- a/radicle-httpd/src/api/v1/projects.rs +++ b/radicle-httpd/src/api/v1/projects.rs @@ -606,7 +606,7 @@ async fn readme_handler( async fn issues_handler( State(ctx): State, Path(project): Path, - Query(qs): Query>, + Query(qs): Query>, ) -> impl IntoResponse { let (repo, _) = ctx.repo(project)?; let CobsQuery { @@ -660,7 +660,7 @@ async fn issue_handler( async fn patches_handler( State(ctx): State, Path(rid): Path, - Query(qs): Query>, + Query(qs): Query>, ) -> impl IntoResponse { let (repo, _) = ctx.repo(rid)?; let CobsQuery {