mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 10:32:19 +00:00
Lots of clippy appeasement
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user