From 1847160369a2b8ee6521bfc4b2c8142ce5835862 Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Tue, 21 Aug 2018 17:15:33 -0400 Subject: [PATCH] No reason to impl Deser for both the ApiError and Error types --- src/errors.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index efc722c..0559d3c 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -13,39 +13,29 @@ use url::ParseError as UrlError; pub type Result = ::std::result::Result; /// enum of possible errors encountered using the mastodon API. -#[derive(Debug, Deserialize)] -#[serde(untagged)] +#[derive(Debug)] pub enum Error { /// Error from the Mastodon API. This typically means something went /// wrong with your authentication or data. Api(ApiError), /// Error deserialising to json. Typically represents a breaking change in /// the Mastodon API - #[serde(skip_deserializing)] Serde(SerdeError), /// Error encountered in the HTTP backend while requesting a route. - #[serde(skip_deserializing)] Http(HttpError), /// Wrapper around the `std::io::Error` struct. - #[serde(skip_deserializing)] Io(IoError), /// Wrapper around the `url::ParseError` struct. - #[serde(skip_deserializing)] Url(UrlError), /// Missing Client Id. - #[serde(skip_deserializing)] ClientIdRequired, /// Missing Client Secret. - #[serde(skip_deserializing)] ClientSecretRequired, /// Missing Access Token. - #[serde(skip_deserializing)] AccessTokenRequired, /// Generic client error. - #[serde(skip_deserializing)] Client(StatusCode), /// Generic server error. - #[serde(skip_deserializing)] Server(StatusCode), } @@ -104,4 +94,5 @@ from! { IoError, Io, SerdeError, Serde, UrlError, Url, + ApiError, Api, }