Lots of clippy appeasement

This commit is contained in:
Lennart
2025-10-27 20:12:21 +01:00
parent 0d071d3b92
commit 86cf490fa9
84 changed files with 413 additions and 435 deletions

View File

@@ -62,7 +62,8 @@ pub enum Error {
}
impl Error {
#[must_use] pub fn status_code(&self) -> StatusCode {
#[must_use]
pub fn status_code(&self) -> StatusCode {
match self {
Self::StoreError(err) => match err {
rustical_store::Error::NotFound => StatusCode::NOT_FOUND,
@@ -70,12 +71,11 @@ impl Error {
rustical_store::Error::ReadOnly => StatusCode::FORBIDDEN,
_ => StatusCode::INTERNAL_SERVER_ERROR,
},
Self::ChronoParseError(_) => StatusCode::INTERNAL_SERVER_ERROR,
Self::DavError(err) => StatusCode::try_from(err.status_code().as_u16())
.expect("Just converting between versions"),
Self::Unauthorized => StatusCode::UNAUTHORIZED,
Self::XmlDecodeError(_) => StatusCode::BAD_REQUEST,
Self::NotImplemented => StatusCode::INTERNAL_SERVER_ERROR,
Self::ChronoParseError(_) | Self::NotImplemented => StatusCode::INTERNAL_SERVER_ERROR,
Self::NotFound => StatusCode::NOT_FOUND,
Self::IcalError(err) => err.status_code(),
Self::PreconditionFailed(_err) => StatusCode::PRECONDITION_FAILED,