From af9aa1b326aba5f9e55ef71970f008ff2538812e Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sun, 18 Jun 2023 21:17:56 -0700 Subject: [PATCH] Fix clippy warnings --- src/models/user/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/models/user/mod.rs b/src/models/user/mod.rs index 4785a47..6e20014 100644 --- a/src/models/user/mod.rs +++ b/src/models/user/mod.rs @@ -6,7 +6,7 @@ mod tests; use chrono::Utc; use derive_more::From; use reqwest::StatusCode; -use rocket::http::{Cookie, CookieJar}; +use rocket::http::{CookieJar, Cookie}; use serial::*; use serde::Deserialize; @@ -42,7 +42,7 @@ impl User { (response.status(), response.text().await) }; if !status.is_success() { - return Err(GetUserError::DiscordError { + return Err(GetUserError::Discord { status, message: text.ok(), }); @@ -102,10 +102,10 @@ impl User { #[derive(From, Debug)] pub enum GetUserError { - ReqwestError(reqwest::Error), - DeserializeError(serde_json::Error), + Reqwest(reqwest::Error), + Deserialize(serde_json::Error), #[allow(unused)] - DiscordError { + Discord { status: StatusCode, message: Option, }, @@ -113,4 +113,4 @@ pub enum GetUserError { fn parse_cookie_value(cookies: &CookieJar<'_>, name: &str) -> Option { cookies.get_private(name)?.value().parse().ok() -} +} \ No newline at end of file