From bef50474abfbdc3d1444df2f2b34ddd034da07b4 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 18 Aug 2025 10:35:28 +0200 Subject: [PATCH] Un-hide a few elidded lifetimes --- crates/config/src/sections/secrets.rs | 4 ++-- crates/data-model/src/oauth2/authorization_grant.rs | 2 +- crates/oidc-client/tests/it/main.rs | 2 +- crates/oidc-client/tests/it/requests/jose.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/config/src/sections/secrets.rs b/crates/config/src/sections/secrets.rs index 7886e9a57..4bfd30ce3 100644 --- a/crates/config/src/sections/secrets.rs +++ b/crates/config/src/sections/secrets.rs @@ -149,7 +149,7 @@ impl KeyConfig { /// Returns the password in case any is provided. /// /// If `password_file` was given, the password is read from that file. - async fn password(&self) -> anyhow::Result>> { + async fn password(&self) -> anyhow::Result>> { Ok(match &self.password { Some(Password::File(path)) => Some(Cow::Owned(tokio::fs::read(path).await?)), Some(Password::Value(password)) => Some(Cow::Borrowed(password.as_bytes())), @@ -160,7 +160,7 @@ impl KeyConfig { /// Returns the key. /// /// If `key_file` was given, the key is read from that file. - async fn key(&self) -> anyhow::Result> { + async fn key(&self) -> anyhow::Result> { Ok(match &self.key { Key::File(path) => Cow::Owned(tokio::fs::read(path).await?), Key::Value(key) => Cow::Borrowed(key.as_bytes()), diff --git a/crates/data-model/src/oauth2/authorization_grant.rs b/crates/data-model/src/oauth2/authorization_grant.rs index 383701bcb..d6699f575 100644 --- a/crates/data-model/src/oauth2/authorization_grant.rs +++ b/crates/data-model/src/oauth2/authorization_grant.rs @@ -173,7 +173,7 @@ impl std::ops::Deref for AuthorizationGrant { impl AuthorizationGrant { #[must_use] - pub fn parse_login_hint(&self, homeserver: &str) -> LoginHint { + pub fn parse_login_hint(&self, homeserver: &str) -> LoginHint<'_> { let Some(login_hint) = &self.login_hint else { return LoginHint::None; }; diff --git a/crates/oidc-client/tests/it/main.rs b/crates/oidc-client/tests/it/main.rs index ce595661d..cc8641085 100644 --- a/crates/oidc-client/tests/it/main.rs +++ b/crates/oidc-client/tests/it/main.rs @@ -74,7 +74,7 @@ fn keystore(alg: &JsonWebSignatureAlg) -> Keystore { } /// Generate an ID token. -fn id_token(issuer: &str) -> (IdToken, PublicJsonWebKeySet) { +fn id_token(issuer: &str) -> (IdToken<'_>, PublicJsonWebKeySet) { let signing_alg = ID_TOKEN_SIGNING_ALG; let keystore = keystore(&signing_alg); diff --git a/crates/oidc-client/tests/it/requests/jose.rs b/crates/oidc-client/tests/it/requests/jose.rs index dcca40252..6adedc570 100644 --- a/crates/oidc-client/tests/it/requests/jose.rs +++ b/crates/oidc-client/tests/it/requests/jose.rs @@ -34,7 +34,7 @@ fn id_token( issuer: &str, flag: Option, auth_time: Option>, -) -> (IdToken, PublicJsonWebKeySet) { +) -> (IdToken<'_>, PublicJsonWebKeySet) { let signing_alg = ID_TOKEN_SIGNING_ALG; let keystore = keystore(&signing_alg);