From 43a20d43b09876082e54b550087f166aabdab82d Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Fri, 13 Sep 2024 01:46:53 -0400 Subject: Suggested fixes from Clippy, via nursery and pedantic sets. --- src/login/app.rs | 2 +- src/login/extract/identity_token.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/login') diff --git a/src/login/app.rs b/src/login/app.rs index 85fa024..cd65f35 100644 --- a/src/login/app.rs +++ b/src/login/app.rs @@ -14,7 +14,7 @@ pub struct Logins<'a> { } impl<'a> Logins<'a> { - pub fn new(db: &'a SqlitePool) -> Self { + pub const fn new(db: &'a SqlitePool) -> Self { Self { db } } diff --git a/src/login/extract/identity_token.rs b/src/login/extract/identity_token.rs index c322f7b..3be3f09 100644 --- a/src/login/extract/identity_token.rs +++ b/src/login/extract/identity_token.rs @@ -31,7 +31,7 @@ impl IdentityToken { .permanent() .build(); - IdentityToken { + Self { cookies: self.cookies.add(identity_cookie), } } @@ -39,7 +39,7 @@ impl IdentityToken { /// Remove the identity secret and ensure that it will be cleared when this /// extractor is included in a response. pub fn clear(self) -> Self { - IdentityToken { + Self { cookies: self.cookies.remove(IDENTITY_COOKIE), } } @@ -56,7 +56,7 @@ where async fn from_request_parts(parts: &mut Parts, state: &S) -> Result { let cookies = CookieJar::from_request_parts(parts, state).await?; - Ok(IdentityToken { cookies }) + Ok(Self { cookies }) } } @@ -64,7 +64,7 @@ impl IntoResponseParts for IdentityToken { type Error = Infallible; fn into_response_parts(self, res: ResponseParts) -> Result { - let IdentityToken { cookies } = self; + let Self { cookies } = self; cookies.into_response_parts(res) } } -- cgit v1.2.3