use serde deserializer functions to remove duplicated structs, remove TryFrom impls, replace Language enum with wrapper around isolang Language type
This commit is contained in:
13
src/error.rs
13
src/error.rs
@@ -171,6 +171,11 @@ pub enum IdQueryResultError {
|
||||
IdQueryResult(#[from] IdQueryResponseError),
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum PublicationDemographicError {
|
||||
InvalidValue,
|
||||
}
|
||||
|
||||
#[derive(Debug, Error, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ApiError {
|
||||
@@ -208,6 +213,14 @@ impl fmt::Display for ChapterImagesContentError {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for PublicationDemographicError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::InvalidValue => "InvalidValue".fmt(f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl serde::de::Error for JsonError {
|
||||
fn custom<T: fmt::Display>(msg: T) -> Self {
|
||||
JsonError::Message(msg.to_string())
|
||||
|
||||
Reference in New Issue
Block a user