From 01540c63b15684116a632c6eda3f3f410aa264d0 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Thu, 5 Dec 2024 17:03:26 +0100 Subject: [PATCH] Upgrade to Rust 1.83.0 and fix new warnings --- .github/workflows/ci.yaml | 4 ++-- Dockerfile | 6 +++--- crates/i18n-scan/src/minijinja.rs | 16 ++++++++-------- crates/i18n/src/sprintf/formatter.rs | 2 +- crates/jose/src/claims.rs | 6 +++--- crates/jose/src/constraints.rs | 2 +- crates/jose/src/jwt/raw.rs | 4 ++-- crates/jose/src/jwt/signed.rs | 4 ++-- crates/keystore/src/lib.rs | 8 +++----- crates/spa/src/vite.rs | 2 +- crates/storage-pg/src/app_session.rs | 2 +- crates/storage-pg/src/compat/access_token.rs | 2 +- crates/storage-pg/src/compat/refresh_token.rs | 2 +- crates/storage-pg/src/compat/session.rs | 2 +- crates/storage-pg/src/compat/sso_login.rs | 2 +- crates/storage-pg/src/job.rs | 2 +- crates/storage-pg/src/oauth2/access_token.rs | 2 +- .../storage-pg/src/oauth2/authorization_grant.rs | 2 +- crates/storage-pg/src/oauth2/client.rs | 2 +- .../storage-pg/src/oauth2/device_code_grant.rs | 2 +- crates/storage-pg/src/oauth2/refresh_token.rs | 2 +- crates/storage-pg/src/oauth2/session.rs | 2 +- crates/storage-pg/src/upstream_oauth2/link.rs | 2 +- .../storage-pg/src/upstream_oauth2/provider.rs | 2 +- crates/storage-pg/src/upstream_oauth2/session.rs | 2 +- crates/storage-pg/src/user/email.rs | 2 +- crates/storage-pg/src/user/mod.rs | 2 +- crates/storage-pg/src/user/password.rs | 2 +- crates/storage-pg/src/user/recovery.rs | 2 +- crates/storage-pg/src/user/session.rs | 2 +- crates/storage-pg/src/user/terms.rs | 2 +- crates/storage/src/upstream_oauth2/provider.rs | 2 +- crates/storage/src/user/mod.rs | 2 +- crates/tower/src/metrics/make_attributes.rs | 6 +++--- 34 files changed, 52 insertions(+), 54 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f71c8d7d3..da477d68e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -195,8 +195,8 @@ jobs: - name: Install toolchain run: | - rustup toolchain install 1.82.0 - rustup default 1.82.0 + rustup toolchain install 1.83.0 + rustup default 1.83.0 rustup component add clippy - name: Setup OPA diff --git a/Dockerfile b/Dockerfile index bec8f2903..7824f9fad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,11 @@ # The Debian version and version name must be in sync ARG DEBIAN_VERSION=12 ARG DEBIAN_VERSION_NAME=bookworm -ARG RUSTC_VERSION=1.82.0 +ARG RUSTC_VERSION=1.83.0 ARG NODEJS_VERSION=20.15.0 ARG OPA_VERSION=0.64.1 -ARG CARGO_AUDITABLE_VERSION=0.6.4 -ARG CARGO_CHEF_VERSION=0.1.67 +ARG CARGO_AUDITABLE_VERSION=0.6.6 +ARG CARGO_CHEF_VERSION=0.1.68 ########################################## ## Build stage that builds the frontend ## diff --git a/crates/i18n-scan/src/minijinja.rs b/crates/i18n-scan/src/minijinja.rs index f56506970..852a54488 100644 --- a/crates/i18n-scan/src/minijinja.rs +++ b/crates/i18n-scan/src/minijinja.rs @@ -19,7 +19,7 @@ pub fn find_in_stmt<'a>(context: &mut Context, stmt: &'a Stmt<'a>) -> Result<(), Stmt::EmitRaw(_raw) => {} Stmt::ForLoop(for_loop) => { find_in_expr(context, &for_loop.iter)?; - find_in_optional_expr(context, &for_loop.filter_expr)?; + find_in_optional_expr(context, for_loop.filter_expr.as_ref())?; find_in_expr(context, &for_loop.target)?; find_in_stmts(context, &for_loop.body)?; find_in_stmts(context, &for_loop.else_body)?; @@ -66,7 +66,7 @@ pub fn find_in_stmt<'a>(context: &mut Context, stmt: &'a Stmt<'a>) -> Result<(), find_in_expr(context, &from_import.expr)?; for (name, alias) in &from_import.names { find_in_expr(context, name)?; - find_in_optional_expr(context, alias)?; + find_in_optional_expr(context, alias.as_ref())?; } } Stmt::Extends(extends) => { @@ -185,9 +185,9 @@ fn find_in_expr<'a>(context: &mut Context, expr: &'a Expr<'a>) -> Result<(), min Expr::Const(_const) => {} Expr::Slice(slice) => { find_in_expr(context, &slice.expr)?; - find_in_optional_expr(context, &slice.start)?; - find_in_optional_expr(context, &slice.stop)?; - find_in_optional_expr(context, &slice.step)?; + find_in_optional_expr(context, slice.start.as_ref())?; + find_in_optional_expr(context, slice.stop.as_ref())?; + find_in_optional_expr(context, slice.step.as_ref())?; } Expr::UnaryOp(unary_op) => { find_in_expr(context, &unary_op.expr)?; @@ -199,10 +199,10 @@ fn find_in_expr<'a>(context: &mut Context, expr: &'a Expr<'a>) -> Result<(), min Expr::IfExpr(if_expr) => { find_in_expr(context, &if_expr.test_expr)?; find_in_expr(context, &if_expr.true_expr)?; - find_in_optional_expr(context, &if_expr.false_expr)?; + find_in_optional_expr(context, if_expr.false_expr.as_ref())?; } Expr::Filter(filter) => { - find_in_optional_expr(context, &filter.expr)?; + find_in_optional_expr(context, filter.expr.as_ref())?; find_in_call_args(context, &filter.args)?; } Expr::Test(test) => { @@ -241,7 +241,7 @@ fn find_in_exprs<'a>(context: &mut Context, exprs: &'a [Expr<'a>]) -> Result<(), fn find_in_optional_expr<'a>( context: &mut Context, - expr: &'a Option>, + expr: Option<&'a Expr<'a>>, ) -> Result<(), minijinja::Error> { if let Some(expr) = expr { find_in_expr(context, expr)?; diff --git a/crates/i18n/src/sprintf/formatter.rs b/crates/i18n/src/sprintf/formatter.rs index 05d446a67..be3a8cdc0 100644 --- a/crates/i18n/src/sprintf/formatter.rs +++ b/crates/i18n/src/sprintf/formatter.rs @@ -483,7 +483,7 @@ pub enum FormattedMessagePart<'a> { Placeholder(String), } -impl<'a> FormattedMessagePart<'a> { +impl FormattedMessagePart<'_> { fn len(&self) -> usize { match self { FormattedMessagePart::Text(text) => text.len(), diff --git a/crates/jose/src/claims.rs b/crates/jose/src/claims.rs index 1c7d8d904..0d1929953 100644 --- a/crates/jose/src/claims.rs +++ b/crates/jose/src/claims.rs @@ -334,7 +334,7 @@ impl<'a> TokenHash<'a> { } } -impl<'a> Validator for TokenHash<'a> { +impl Validator for TokenHash<'_> { type Error = TokenHashError; fn validate(&self, value: &String) -> Result<(), Self::Error> { if hash_token(self.alg, self.token)? == *value { @@ -362,7 +362,7 @@ impl<'a, T: ?Sized> Equality<'a, T> { } } -impl<'a, T1, T2> Validator for Equality<'a, T2> +impl Validator for Equality<'_, T2> where T2: PartialEq + ?Sized, { @@ -399,7 +399,7 @@ impl<'a, T> Contains<'a, T> { #[error("OneOrMany doesn't contain value")] pub struct ContainsError; -impl<'a, T> Validator> for Contains<'a, T> +impl Validator> for Contains<'_, T> where T: PartialEq, { diff --git a/crates/jose/src/constraints.rs b/crates/jose/src/constraints.rs index c9a521d8c..23e0ec712 100644 --- a/crates/jose/src/constraints.rs +++ b/crates/jose/src/constraints.rs @@ -91,7 +91,7 @@ pub trait Constrainable { fn kty(&self) -> JsonWebKeyType; } -impl<'a> Constraint<'a> { +impl Constraint<'_> { fn decide(&self, constrainable: &T) -> ConstraintDecision { match self { Constraint::Alg { constraint_alg } => { diff --git a/crates/jose/src/jwt/raw.rs b/crates/jose/src/jwt/raw.rs index 54e43b7e6..869150346 100644 --- a/crates/jose/src/jwt/raw.rs +++ b/crates/jose/src/jwt/raw.rs @@ -25,7 +25,7 @@ impl RawJwt<'static> { } } -impl<'a> std::fmt::Display for RawJwt<'a> { +impl std::fmt::Display for RawJwt<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.inner) } @@ -57,7 +57,7 @@ impl<'a> RawJwt<'a> { } } -impl<'a> Deref for RawJwt<'a> { +impl Deref for RawJwt<'_> { type Target = str; fn deref(&self) -> &Self::Target { diff --git a/crates/jose/src/jwt/signed.rs b/crates/jose/src/jwt/signed.rs index 291fcf7cc..4b9f881fa 100644 --- a/crates/jose/src/jwt/signed.rs +++ b/crates/jose/src/jwt/signed.rs @@ -21,13 +21,13 @@ pub struct Jwt<'a, T> { signature: Vec, } -impl<'a, T> std::fmt::Display for Jwt<'a, T> { +impl std::fmt::Display for Jwt<'_, T> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.raw) } } -impl<'a, T> std::fmt::Debug for Jwt<'a, T> +impl std::fmt::Debug for Jwt<'_, T> where T: std::fmt::Debug, { diff --git a/crates/keystore/src/lib.rs b/crates/keystore/src/lib.rs index fcb00cf5e..36e1aaa89 100644 --- a/crates/keystore/src/lib.rs +++ b/crates/keystore/src/lib.rs @@ -354,11 +354,9 @@ impl PrivateKey { pkcs8::EncryptedPrivateKeyInfo::PEM_LABEL => { let info = pkcs8::EncryptedPrivateKeyInfo::from_der(&doc)?; let decrypted = info.decrypt(password)?; - return Self::load_der(decrypted.as_bytes()).map_err(|inner| { - LoadError::InEncrypted { - inner: Box::new(inner), - } - }); + Self::load_der(decrypted.as_bytes()).map_err(|inner| LoadError::InEncrypted { + inner: Box::new(inner), + }) } pkcs1::RsaPrivateKey::PEM_LABEL diff --git a/crates/spa/src/vite.rs b/crates/spa/src/vite.rs index 278dd31ad..31d5d3c7e 100644 --- a/crates/spa/src/vite.rs +++ b/crates/spa/src/vite.rs @@ -229,7 +229,7 @@ impl Manifest { &'a self, current_entry: &'a ManifestEntry, entries: &mut BTreeSet>, - ) -> Result> { + ) -> Result, InvalidManifest<'a>> { let asset = Asset::new(current_entry)?; let inserted = entries.insert(asset); diff --git a/crates/storage-pg/src/app_session.rs b/crates/storage-pg/src/app_session.rs index 70ab17035..6905dbc1e 100644 --- a/crates/storage-pg/src/app_session.rs +++ b/crates/storage-pg/src/app_session.rs @@ -245,7 +245,7 @@ fn split_filter( } #[async_trait] -impl<'c> AppSessionRepository for PgAppSessionRepository<'c> { +impl AppSessionRepository for PgAppSessionRepository<'_> { type Error = DatabaseError; #[allow(clippy::too_many_lines)] diff --git a/crates/storage-pg/src/compat/access_token.rs b/crates/storage-pg/src/compat/access_token.rs index 211c699fd..a4458e475 100644 --- a/crates/storage-pg/src/compat/access_token.rs +++ b/crates/storage-pg/src/compat/access_token.rs @@ -50,7 +50,7 @@ impl From for CompatAccessToken { } #[async_trait] -impl<'c> CompatAccessTokenRepository for PgCompatAccessTokenRepository<'c> { +impl CompatAccessTokenRepository for PgCompatAccessTokenRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/compat/refresh_token.rs b/crates/storage-pg/src/compat/refresh_token.rs index c191c4776..70e3f109c 100644 --- a/crates/storage-pg/src/compat/refresh_token.rs +++ b/crates/storage-pg/src/compat/refresh_token.rs @@ -59,7 +59,7 @@ impl From for CompatRefreshToken { } #[async_trait] -impl<'c> CompatRefreshTokenRepository for PgCompatRefreshTokenRepository<'c> { +impl CompatRefreshTokenRepository for PgCompatRefreshTokenRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/compat/session.rs b/crates/storage-pg/src/compat/session.rs index 913a60d67..12001cfe6 100644 --- a/crates/storage-pg/src/compat/session.rs +++ b/crates/storage-pg/src/compat/session.rs @@ -260,7 +260,7 @@ impl Filter for CompatSessionFilter<'_> { } #[async_trait] -impl<'c> CompatSessionRepository for PgCompatSessionRepository<'c> { +impl CompatSessionRepository for PgCompatSessionRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/compat/sso_login.rs b/crates/storage-pg/src/compat/sso_login.rs index c05d58df1..5e6121a81 100644 --- a/crates/storage-pg/src/compat/sso_login.rs +++ b/crates/storage-pg/src/compat/sso_login.rs @@ -128,7 +128,7 @@ impl Filter for CompatSsoLoginFilter<'_> { } #[async_trait] -impl<'c> CompatSsoLoginRepository for PgCompatSsoLoginRepository<'c> { +impl CompatSsoLoginRepository for PgCompatSsoLoginRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/job.rs b/crates/storage-pg/src/job.rs index 2a12cde7e..f0630458a 100644 --- a/crates/storage-pg/src/job.rs +++ b/crates/storage-pg/src/job.rs @@ -26,7 +26,7 @@ impl<'c> PgJobRepository<'c> { } #[async_trait] -impl<'c> JobRepository for PgJobRepository<'c> { +impl JobRepository for PgJobRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/oauth2/access_token.rs b/crates/storage-pg/src/oauth2/access_token.rs index 6bc45299b..ea8be74d3 100644 --- a/crates/storage-pg/src/oauth2/access_token.rs +++ b/crates/storage-pg/src/oauth2/access_token.rs @@ -57,7 +57,7 @@ impl From for AccessToken { } #[async_trait] -impl<'c> OAuth2AccessTokenRepository for PgOAuth2AccessTokenRepository<'c> { +impl OAuth2AccessTokenRepository for PgOAuth2AccessTokenRepository<'_> { type Error = DatabaseError; async fn lookup(&mut self, id: Ulid) -> Result, Self::Error> { diff --git a/crates/storage-pg/src/oauth2/authorization_grant.rs b/crates/storage-pg/src/oauth2/authorization_grant.rs index 12450ca4b..934e08cec 100644 --- a/crates/storage-pg/src/oauth2/authorization_grant.rs +++ b/crates/storage-pg/src/oauth2/authorization_grant.rs @@ -192,7 +192,7 @@ impl TryFrom for AuthorizationGrant { } #[async_trait] -impl<'c> OAuth2AuthorizationGrantRepository for PgOAuth2AuthorizationGrantRepository<'c> { +impl OAuth2AuthorizationGrantRepository for PgOAuth2AuthorizationGrantRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/oauth2/client.rs b/crates/storage-pg/src/oauth2/client.rs index dbfa24d25..eeb09d0f9 100644 --- a/crates/storage-pg/src/oauth2/client.rs +++ b/crates/storage-pg/src/oauth2/client.rs @@ -251,7 +251,7 @@ impl TryInto for OAuth2ClientLookup { } #[async_trait] -impl<'c> OAuth2ClientRepository for PgOAuth2ClientRepository<'c> { +impl OAuth2ClientRepository for PgOAuth2ClientRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/oauth2/device_code_grant.rs b/crates/storage-pg/src/oauth2/device_code_grant.rs index e0bb5bcd0..fb8883dd0 100644 --- a/crates/storage-pg/src/oauth2/device_code_grant.rs +++ b/crates/storage-pg/src/oauth2/device_code_grant.rs @@ -138,7 +138,7 @@ impl TryFrom for DeviceCodeGrant { } #[async_trait] -impl<'c> OAuth2DeviceCodeGrantRepository for PgOAuth2DeviceCodeGrantRepository<'c> { +impl OAuth2DeviceCodeGrantRepository for PgOAuth2DeviceCodeGrantRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/oauth2/refresh_token.rs b/crates/storage-pg/src/oauth2/refresh_token.rs index d45574918..bc0480a67 100644 --- a/crates/storage-pg/src/oauth2/refresh_token.rs +++ b/crates/storage-pg/src/oauth2/refresh_token.rs @@ -57,7 +57,7 @@ impl From for RefreshToken { } #[async_trait] -impl<'c> OAuth2RefreshTokenRepository for PgOAuth2RefreshTokenRepository<'c> { +impl OAuth2RefreshTokenRepository for PgOAuth2RefreshTokenRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/oauth2/session.rs b/crates/storage-pg/src/oauth2/session.rs index 5993596bc..961094821 100644 --- a/crates/storage-pg/src/oauth2/session.rs +++ b/crates/storage-pg/src/oauth2/session.rs @@ -137,7 +137,7 @@ impl Filter for OAuth2SessionFilter<'_> { } #[async_trait] -impl<'c> OAuth2SessionRepository for PgOAuth2SessionRepository<'c> { +impl OAuth2SessionRepository for PgOAuth2SessionRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/upstream_oauth2/link.rs b/crates/storage-pg/src/upstream_oauth2/link.rs index 15ac3d55b..9f9d46c73 100644 --- a/crates/storage-pg/src/upstream_oauth2/link.rs +++ b/crates/storage-pg/src/upstream_oauth2/link.rs @@ -105,7 +105,7 @@ impl Filter for UpstreamOAuthLinkFilter<'_> { } #[async_trait] -impl<'c> UpstreamOAuthLinkRepository for PgUpstreamOAuthLinkRepository<'c> { +impl UpstreamOAuthLinkRepository for PgUpstreamOAuthLinkRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/upstream_oauth2/provider.rs b/crates/storage-pg/src/upstream_oauth2/provider.rs index e66088157..35412d460 100644 --- a/crates/storage-pg/src/upstream_oauth2/provider.rs +++ b/crates/storage-pg/src/upstream_oauth2/provider.rs @@ -209,7 +209,7 @@ impl Filter for UpstreamOAuthProviderFilter<'_> { } #[async_trait] -impl<'c> UpstreamOAuthProviderRepository for PgUpstreamOAuthProviderRepository<'c> { +impl UpstreamOAuthProviderRepository for PgUpstreamOAuthProviderRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/upstream_oauth2/session.rs b/crates/storage-pg/src/upstream_oauth2/session.rs index 1cadcfa61..c0d0ed17f 100644 --- a/crates/storage-pg/src/upstream_oauth2/session.rs +++ b/crates/storage-pg/src/upstream_oauth2/session.rs @@ -110,7 +110,7 @@ impl TryFrom for UpstreamOAuthAuthorizationSession { } #[async_trait] -impl<'c> UpstreamOAuthSessionRepository for PgUpstreamOAuthSessionRepository<'c> { +impl UpstreamOAuthSessionRepository for PgUpstreamOAuthSessionRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/user/email.rs b/crates/storage-pg/src/user/email.rs index 93a07aa61..5f4a04fa4 100644 --- a/crates/storage-pg/src/user/email.rs +++ b/crates/storage-pg/src/user/email.rs @@ -116,7 +116,7 @@ impl Filter for UserEmailFilter<'_> { } #[async_trait] -impl<'c> UserEmailRepository for PgUserEmailRepository<'c> { +impl UserEmailRepository for PgUserEmailRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/user/mod.rs b/crates/storage-pg/src/user/mod.rs index 2d99fadf1..8824c299b 100644 --- a/crates/storage-pg/src/user/mod.rs +++ b/crates/storage-pg/src/user/mod.rs @@ -110,7 +110,7 @@ impl Filter for UserFilter<'_> { } #[async_trait] -impl<'c> UserRepository for PgUserRepository<'c> { +impl UserRepository for PgUserRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/user/password.rs b/crates/storage-pg/src/user/password.rs index 96b42572e..04585e8d9 100644 --- a/crates/storage-pg/src/user/password.rs +++ b/crates/storage-pg/src/user/password.rs @@ -37,7 +37,7 @@ struct UserPasswordLookup { } #[async_trait] -impl<'c> UserPasswordRepository for PgUserPasswordRepository<'c> { +impl UserPasswordRepository for PgUserPasswordRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/user/recovery.rs b/crates/storage-pg/src/user/recovery.rs index 3a171c482..fcab3b9e6 100644 --- a/crates/storage-pg/src/user/recovery.rs +++ b/crates/storage-pg/src/user/recovery.rs @@ -77,7 +77,7 @@ impl From for UserRecoveryTicket { } #[async_trait] -impl<'c> UserRecoveryRepository for PgUserRecoveryRepository<'c> { +impl UserRecoveryRepository for PgUserRecoveryRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/user/session.rs b/crates/storage-pg/src/user/session.rs index 4e19bbe4e..7191e360b 100644 --- a/crates/storage-pg/src/user/session.rs +++ b/crates/storage-pg/src/user/session.rs @@ -149,7 +149,7 @@ impl crate::filter::Filter for BrowserSessionFilter<'_> { } #[async_trait] -impl<'c> BrowserSessionRepository for PgBrowserSessionRepository<'c> { +impl BrowserSessionRepository for PgBrowserSessionRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage-pg/src/user/terms.rs b/crates/storage-pg/src/user/terms.rs index 7cfb385d5..f51024606 100644 --- a/crates/storage-pg/src/user/terms.rs +++ b/crates/storage-pg/src/user/terms.rs @@ -29,7 +29,7 @@ impl<'c> PgUserTermsRepository<'c> { } #[async_trait] -impl<'c> UserTermsRepository for PgUserTermsRepository<'c> { +impl UserTermsRepository for PgUserTermsRepository<'_> { type Error = DatabaseError; #[tracing::instrument( diff --git a/crates/storage/src/upstream_oauth2/provider.rs b/crates/storage/src/upstream_oauth2/provider.rs index 10ac08ec5..47050089d 100644 --- a/crates/storage/src/upstream_oauth2/provider.rs +++ b/crates/storage/src/upstream_oauth2/provider.rs @@ -95,7 +95,7 @@ pub struct UpstreamOAuthProviderFilter<'a> { _lifetime: PhantomData<&'a ()>, } -impl<'a> UpstreamOAuthProviderFilter<'a> { +impl UpstreamOAuthProviderFilter<'_> { /// Create a new [`UpstreamOAuthProviderFilter`] with default values #[must_use] pub fn new() -> Self { diff --git a/crates/storage/src/user/mod.rs b/crates/storage/src/user/mod.rs index 0b25b841c..fcd1381d3 100644 --- a/crates/storage/src/user/mod.rs +++ b/crates/storage/src/user/mod.rs @@ -63,7 +63,7 @@ pub struct UserFilter<'a> { _phantom: std::marker::PhantomData<&'a ()>, } -impl<'a> UserFilter<'a> { +impl UserFilter<'_> { /// Create a new [`UserFilter`] with default values #[must_use] pub fn new() -> Self { diff --git a/crates/tower/src/metrics/make_attributes.rs b/crates/tower/src/metrics/make_attributes.rs index a57636b4b..d01b22f07 100644 --- a/crates/tower/src/metrics/make_attributes.rs +++ b/crates/tower/src/metrics/make_attributes.rs @@ -56,7 +56,7 @@ where T: 'static, { type Iter<'a> = Box + 'a>; - fn attributes<'a>(&'a self, t: &'a T) -> Self::Iter<'_> { + fn attributes<'a>(&'a self, t: &'a T) -> Self::Iter<'a> { Box::new(self.iter().flat_map(|v| v.attributes(t))) } } @@ -67,7 +67,7 @@ where T: 'static, { type Iter<'a> = Box + 'a>; - fn attributes<'a>(&'a self, t: &'a T) -> Self::Iter<'_> { + fn attributes<'a>(&'a self, t: &'a T) -> Self::Iter<'a> { Box::new(self.iter().flat_map(|v| v.attributes(t))) } } @@ -100,7 +100,7 @@ where { type Iter<'a> = std::iter::Flatten>>; - fn attributes<'a>(&'a self, t: &'a T) -> Self::Iter<'_> { + fn attributes<'a>(&'a self, t: &'a T) -> Self::Iter<'a> { self.as_ref().map(|v| v.attributes(t)).into_iter().flatten() } }