summaryrefslogtreecommitdiff
path: root/src/channel/routes/post.rs
diff options
context:
space:
mode:
authorojacobson <ojacobson@noreply.codeberg.org>2025-05-27 04:09:01 +0200
committerojacobson <ojacobson@noreply.codeberg.org>2025-05-27 04:09:01 +0200
commit79d3598282fd573931e7cb14e4d3e54aad7c943c (patch)
treebeb3cd0de5077288f8a6c81373b6d0b7b737609f /src/channel/routes/post.rs
parent1786c1eb9d13e570b028bef1206041f48d881cf0 (diff)
parent841fc1355ecef4636ad9f5ad6d081f72eeb868ac (diff)
Remove a bunch of clippy suppressions.
Notably, one of them was hiding a real (if unreachable) bug, by converting a "the token you have presented is not valid because the user was deleted" scenario into an internal server error, when it should have been an authorization error.
Diffstat (limited to 'src/channel/routes/post.rs')
-rw-r--r--src/channel/routes/post.rs5
1 files changed, 3 insertions, 2 deletions
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()
+ }
}
}
}