diff options
author | Vika <vika@fireburn.ru> | 2022-09-21 10:44:15 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-09-28 00:59:43 +0300 |
commit | 2f02bf76a40c971b9404aa0913bc8baa7dfde24c (patch) | |
tree | 4ce2dfac9564ce80af02df5b802c10cf4d100f2e /kittybox-rs/util/src | |
parent | e5281c6da75f115d01aa5bef2f460ebd5b30a656 (diff) | |
download | kittybox-2f02bf76a40c971b9404aa0913bc8baa7dfde24c.tar.zst |
Fix some clippy errors
Diffstat (limited to 'kittybox-rs/util/src')
-rw-r--r-- | kittybox-rs/util/src/error.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kittybox-rs/util/src/error.rs b/kittybox-rs/util/src/error.rs index 7edf176..1c95020 100644 --- a/kittybox-rs/util/src/error.rs +++ b/kittybox-rs/util/src/error.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; use http::StatusCode; use axum_core::response::{Response, IntoResponse}; -#[derive(Serialize, Deserialize, PartialEq, Debug)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] #[serde(rename_all = "snake_case")] /// Kinds of errors that can happen within a Micropub operation. pub enum ErrorType { @@ -27,7 +27,9 @@ pub enum ErrorType { /// Representation of the Micropub API error. #[derive(Serialize, Deserialize, Debug)] pub struct MicropubError { + /// General kind of an error that occured. pub error: ErrorType, + /// A human-readable error description intended for application developers. // TODO use Cow<'static, str> to save on heap allocations pub error_description: String, } @@ -52,6 +54,7 @@ impl From<serde_json::Error> for MicropubError { } impl MicropubError { + /// Create a new Micropub error. pub fn new(error: ErrorType, error_description: &str) -> Self { Self { error, |