From 24512469e9c760b835a6f6fa2fc2d95f3df930c3 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 27 Mar 2025 11:40:18 -0700 Subject: [PATCH] cargo clippy --fix --- tegakituesday/src/models/mod.rs | 2 +- tegakituesday/src/models/submission/legacy_submission.rs | 2 +- tegakituesday/src/models/user/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tegakituesday/src/models/mod.rs b/tegakituesday/src/models/mod.rs index dcf6dc8..5837849 100644 --- a/tegakituesday/src/models/mod.rs +++ b/tegakituesday/src/models/mod.rs @@ -1,5 +1,5 @@ mod user; -pub use user::{SessionUser, User, Username}; +pub use user::{SessionUser, User}; mod challenge; pub use challenge::Challenge; diff --git a/tegakituesday/src/models/submission/legacy_submission.rs b/tegakituesday/src/models/submission/legacy_submission.rs index 6e14072..3dd63f4 100644 --- a/tegakituesday/src/models/submission/legacy_submission.rs +++ b/tegakituesday/src/models/submission/legacy_submission.rs @@ -45,7 +45,7 @@ impl LegacySubmission { .next()? // Get last number .split('-') - .last()? + .next_back()? .parse() .ok() // Check if discriminator or timestamp, then convert diff --git a/tegakituesday/src/models/user/mod.rs b/tegakituesday/src/models/user/mod.rs index 76d5cd1..a1a3794 100644 --- a/tegakituesday/src/models/user/mod.rs +++ b/tegakituesday/src/models/user/mod.rs @@ -169,7 +169,7 @@ impl SessionUser { .get(TOKEN_EXPIRE_COOKIE) .map(|expire| expire.value().parse::()) .and_then(Result::ok) - .map_or(true, |timestamp| Utc::now().timestamp() >= timestamp) + .is_none_or(|timestamp| Utc::now().timestamp() >= timestamp) { cookies.remove_private(Cookie::named(TOKEN_COOKIE)); cookies.remove_private(Cookie::named(USER_ID_COOKIE));