From c7829873a1568c218bdb9b19060d331e67e9f5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 14 Sep 2026 05:10:28 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20style:=20zero=20clippy/rustc=20w?= =?UTF-8?q?arnings=20project-wide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Box the large LoginResponse::LoggedIn variant and drop the let-and-return in login_as_school. --- src/web/auth.rs | 4 ++-- tests/common/mod.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/web/auth.rs b/src/web/auth.rs index 5b6d58d..5e4aaec 100644 --- a/src/web/auth.rs +++ b/src/web/auth.rs @@ -99,7 +99,7 @@ struct SchoolChoiceResponse { #[derive(Serialize, ToSchema)] #[serde(untagged)] enum LoginResponse { - LoggedIn(UserResponse), + LoggedIn(Box), ChooseSchool(SchoolChoiceResponse), } @@ -296,7 +296,7 @@ async fn login( ); Ok(( jar.add(cookie), - Json(LoginResponse::LoggedIn(UserResponse::new(&user))), + Json(LoginResponse::LoggedIn(Box::new(UserResponse::new(&user)))), )) } many => { diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 16e3a5c..6ee159b 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -233,7 +233,7 @@ pub async fn login_as_school( // The account is a person: if `username` already belongs to another // school, login answers a choice list and never names a school — bind // the school this helper was called for. - let cookie = if res.body["schools"].is_array() { + if res.body["schools"].is_array() { let selected = send( app, "POST", @@ -251,8 +251,7 @@ pub async fn login_as_school( selected.cookie.expect("school cookie after selection") } else { res.cookie.expect("session cookie set on login") - }; - cookie + } } /// Send one request through `app`. `cookie` is a raw `Cookie` header value.