From 7db1817011775695a049f7bb02453d073b907e3e Mon Sep 17 00:00:00 2001 From: snow flurry Date: Tue, 23 Apr 2024 21:20:52 -0700 Subject: [PATCH] web: Appease clippy --- src/web.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/web.rs b/src/web.rs index 7ad6c8c..fde5ef6 100644 --- a/src/web.rs +++ b/src/web.rs @@ -39,24 +39,24 @@ struct RequestDevicePayload { #[derive(Debug)] pub enum Error { - IoError(std::io::Error), - WsError(tokio_websockets::Error), - JsonError(serde_json::Error), + Io(std::io::Error), + Websocket(tokio_websockets::Error), + Json(serde_json::Error), NoData, InvalidUri(http::uri::InvalidUri), - HttpError(reqwest::Error), + Http(reqwest::Error), UnexpectedStatus(reqwest::StatusCode), } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::IoError(err) => err.fmt(f), - Self::WsError(err) => err.fmt(f), - Self::JsonError(err) => err.fmt(f), + Self::Io(err) => err.fmt(f), + Self::Websocket(err) => err.fmt(f), + Self::Json(err) => err.fmt(f), Self::NoData => write!(f, "No data received from web server"), Self::InvalidUri(err) => err.fmt(f), - Self::HttpError(err) => err.fmt(f), + Self::Http(err) => err.fmt(f), Self::UnexpectedStatus(code) => write!(f, "Unexpected response: {}", code), } } @@ -64,19 +64,19 @@ impl fmt::Display for Error { impl From for Error { fn from(value: std::io::Error) -> Self { - Error::IoError(value) + Error::Io(value) } } impl From for Error { fn from(value: tokio_websockets::Error) -> Self { - Self::WsError(value) + Self::Websocket(value) } } impl From for Error { fn from(value: serde_json::Error) -> Self { - Self::JsonError(value) + Self::Json(value) } } @@ -88,7 +88,7 @@ impl From for Error { impl From for Error { fn from(value: reqwest::Error) -> Self { - Self::HttpError(value) + Self::Http(value) } }