diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-05-21 22:43:52 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-05-21 22:49:57 -0400 |
| commit | 841fc1355ecef4636ad9f5ad6d081f72eeb868ac (patch) | |
| tree | d94cbcf5b6edbe8b0aa12bfd0604a31e97afe6e3 /src/channel/routes/post.rs | |
| parent | b3fcd627ae57cd0587363eaf2d5f4635a82bda60 (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" scenario into an internal server error.
Diffstat (limited to 'src/channel/routes/post.rs')
| -rw-r--r-- | src/channel/routes/post.rs | 5 |
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() + } } } } |
