From 3d925edaad80612a8992d080084ef20e2cefec53 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Fri, 16 Jun 2023 17:24:38 -0700 Subject: [PATCH] cargo clippy --fix --- src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 37fb22d..32cdec8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -87,10 +87,8 @@ struct Login<'r> { #[post("/login", data = "")] async fn post_login(login: Form>, cookies: &CookieJar<'_>) -> Redirect { - if login.token_type != "Bearer" || login.scope != "guilds.join+identify+guilds" { - if User::init(login.access_token, cookies).await.is_ok() { - cookies.add(Cookie::new(TOKEN_EXPIRE_COOKIE, (Utc::now() + Duration::seconds(login.expires_in as i64)).timestamp().to_string())); - } + if (login.token_type != "Bearer" || login.scope != "guilds.join+identify+guilds") && User::init(login.access_token, cookies).await.is_ok() { + cookies.add(Cookie::new(TOKEN_EXPIRE_COOKIE, (Utc::now() + Duration::seconds(login.expires_in as i64)).timestamp().to_string())); } Redirect::to("/") }