summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-09-13 01:46:53 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-09-13 02:42:27 -0400
commit43a20d43b09876082e54b550087f166aabdab82d (patch)
tree1c9518d45eed50b3db93a9f0df71c23f5b06f039 /src/login
parent3193a30ebcf6bafdeaf463eda0e7e82082dfe4b5 (diff)
Suggested fixes from Clippy, via nursery and pedantic sets.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/app.rs2
-rw-r--r--src/login/extract/identity_token.rs8
2 files changed, 5 insertions, 5 deletions
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<Self, Self::Rejection> {
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<ResponseParts, Self::Error> {
- let IdentityToken { cookies } = self;
+ let Self { cookies } = self;
cookies.into_response_parts(res)
}
}