From 03351499d066d8ccb02f4fe3dd8f90bce84d1f54 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sun, 29 Dec 2024 22:59:20 +0100 Subject: cargo clippy --- server/src/auth.rs | 10 +++++----- server/src/main.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/src/auth.rs b/server/src/auth.rs index 7cb2d54..c827126 100644 --- a/server/src/auth.rs +++ b/server/src/auth.rs @@ -115,7 +115,7 @@ impl<'r> FromRequest<'r> for Session { .get_private(SESSION_COOKIE) .and_then(|cookie| -> Option { json::from_str(cookie.value()).ok() }) .and_then(|session| { - if validate(&sessions, &session, request) { + if validate(sessions, &session, request) { Some(session) } else { None @@ -146,9 +146,9 @@ fn new_session( sessions_data.active_ids.insert(session_id, now + max_age); } Session { - user_id: user_id, - session_id: session_id, - remote: remote, + user_id, + session_id, + remote, } } @@ -173,7 +173,7 @@ fn login( ) -> Result, Unauthorized<&'static str>> { if login.username == "user" && login.password == "password" { let max_age = Duration::days(i64::from(auth_config.session_max_age_days)); - let session = new_session(&sessions, 1u64, ipaddr.to_string(), max_age); + let session = new_session(sessions, 1u64, ipaddr.to_string(), max_age); let cookie = Cookie::build((SESSION_COOKIE, json::to_string(&session).unwrap())) .path("/api") diff --git a/server/src/main.rs b/server/src/main.rs index b8b4b64..6ec21ef 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -150,7 +150,7 @@ async fn project<'r>( id: r.id, title: r.title, description: r.description, - members: members, + members, }) .map_err(|_| NotFound("No such project")) .await?; @@ -275,8 +275,8 @@ async fn review<'r>( name: r.name, active: r.user_active != 0, }, - reviewers: reviewers, - watchers: watchers, + reviewers, + watchers, state: api_model::ReviewState::try_from(r.state).unwrap(), progress: r.progress, }) -- cgit v1.2.3-70-g09d2