summaryrefslogtreecommitdiff
path: root/src/channel
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel')
-rw-r--r--src/channel/routes/channel/delete.rs5
-rw-r--r--src/channel/routes/channel/post.rs3
-rw-r--r--src/channel/routes/post.rs5
3 files changed, 7 insertions, 6 deletions
diff --git a/src/channel/routes/channel/delete.rs b/src/channel/routes/channel/delete.rs
index 9c093c1..3db7772 100644
--- a/src/channel/routes/channel/delete.rs
+++ b/src/channel/routes/channel/delete.rs
@@ -41,7 +41,6 @@ pub struct Error(#[from] pub app::DeleteError);
impl IntoResponse for Error {
fn into_response(self) -> response::Response {
let Self(error) = self;
- #[allow(clippy::match_wildcard_for_single_variants)]
match error {
app::DeleteError::NotFound(_) | app::DeleteError::Deleted(_) => {
NotFound(error).into_response()
@@ -49,7 +48,9 @@ impl IntoResponse for Error {
app::DeleteError::NotEmpty(_) => {
(StatusCode::CONFLICT, error.to_string()).into_response()
}
- other => Internal::from(other).into_response(),
+ app::DeleteError::Name(_) | app::DeleteError::Database(_) => {
+ Internal::from(error).into_response()
+ }
}
}
}
diff --git a/src/channel/routes/channel/post.rs b/src/channel/routes/channel/post.rs
index 0aad5e5..2547122 100644
--- a/src/channel/routes/channel/post.rs
+++ b/src/channel/routes/channel/post.rs
@@ -49,10 +49,9 @@ pub struct Error(#[from] pub SendError);
impl IntoResponse for Error {
fn into_response(self) -> response::Response {
let Self(error) = self;
- #[allow(clippy::match_wildcard_for_single_variants)]
match error {
SendError::ChannelNotFound(_) => NotFound(error).into_response(),
- other => Internal::from(other).into_response(),
+ SendError::Name(_) | SendError::Database(_) => Internal::from(error).into_response(),
}
}
}
diff --git a/src/channel/routes/post.rs b/src/channel/routes/post.rs
index 72eaad6..6ea9b61 100644
--- a/src/channel/routes/post.rs
+++ b/src/channel/routes/post.rs
@@ -49,7 +49,6 @@ pub struct Error(pub app::CreateError);
impl IntoResponse for Error {
fn into_response(self) -> response::Response {
let Self(error) = self;
- #[allow(clippy::match_wildcard_for_single_variants)]
match error {
app::CreateError::DuplicateName(_) => {
(StatusCode::CONFLICT, error.to_string()).into_response()
@@ -57,7 +56,9 @@ impl IntoResponse for Error {
app::CreateError::InvalidName(_) => {
(StatusCode::BAD_REQUEST, error.to_string()).into_response()
}
- other => Internal::from(other).into_response(),
+ app::CreateError::Name(_) | app::CreateError::Database(_) => {
+ Internal::from(error).into_response()
+ }
}
}
}