Upgrade to Rust 1.83.0 and fix new warnings
This commit is contained in:
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@@ -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
|
||||
|
||||
@@ -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 ##
|
||||
|
||||
@@ -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<'a>>,
|
||||
expr: Option<&'a Expr<'a>>,
|
||||
) -> Result<(), minijinja::Error> {
|
||||
if let Some(expr) = expr {
|
||||
find_in_expr(context, expr)?;
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -334,7 +334,7 @@ impl<'a> TokenHash<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Validator<String> for TokenHash<'a> {
|
||||
impl Validator<String> 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<T1> for Equality<'a, T2>
|
||||
impl<T1, T2> Validator<T1> for Equality<'_, T2>
|
||||
where
|
||||
T2: PartialEq<T1> + ?Sized,
|
||||
{
|
||||
@@ -399,7 +399,7 @@ impl<'a, T> Contains<'a, T> {
|
||||
#[error("OneOrMany doesn't contain value")]
|
||||
pub struct ContainsError;
|
||||
|
||||
impl<'a, T> Validator<OneOrMany<T>> for Contains<'a, T>
|
||||
impl<T> Validator<OneOrMany<T>> for Contains<'_, T>
|
||||
where
|
||||
T: PartialEq,
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ pub trait Constrainable {
|
||||
fn kty(&self) -> JsonWebKeyType;
|
||||
}
|
||||
|
||||
impl<'a> Constraint<'a> {
|
||||
impl Constraint<'_> {
|
||||
fn decide<T: Constrainable>(&self, constrainable: &T) -> ConstraintDecision {
|
||||
match self {
|
||||
Constraint::Alg { constraint_alg } => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -21,13 +21,13 @@ pub struct Jwt<'a, T> {
|
||||
signature: Vec<u8>,
|
||||
}
|
||||
|
||||
impl<'a, T> std::fmt::Display for Jwt<'a, T> {
|
||||
impl<T> 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<T> std::fmt::Debug for Jwt<'_, T>
|
||||
where
|
||||
T: std::fmt::Debug,
|
||||
{
|
||||
|
||||
@@ -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 {
|
||||
Self::load_der(decrypted.as_bytes()).map_err(|inner| LoadError::InEncrypted {
|
||||
inner: Box::new(inner),
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
pkcs1::RsaPrivateKey::PEM_LABEL
|
||||
|
||||
@@ -229,7 +229,7 @@ impl Manifest {
|
||||
&'a self,
|
||||
current_entry: &'a ManifestEntry,
|
||||
entries: &mut BTreeSet<Asset<'a>>,
|
||||
) -> Result<Asset, InvalidManifest<'a>> {
|
||||
) -> Result<Asset<'a>, InvalidManifest<'a>> {
|
||||
let asset = Asset::new(current_entry)?;
|
||||
let inserted = entries.insert(asset);
|
||||
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -50,7 +50,7 @@ impl From<CompatAccessTokenLookup> for CompatAccessToken {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> CompatAccessTokenRepository for PgCompatAccessTokenRepository<'c> {
|
||||
impl CompatAccessTokenRepository for PgCompatAccessTokenRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -59,7 +59,7 @@ impl From<CompatRefreshTokenLookup> for CompatRefreshToken {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> CompatRefreshTokenRepository for PgCompatRefreshTokenRepository<'c> {
|
||||
impl CompatRefreshTokenRepository for PgCompatRefreshTokenRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -57,7 +57,7 @@ impl From<OAuth2AccessTokenLookup> 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<Option<AccessToken>, Self::Error> {
|
||||
|
||||
@@ -192,7 +192,7 @@ impl TryFrom<GrantLookup> for AuthorizationGrant {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> OAuth2AuthorizationGrantRepository for PgOAuth2AuthorizationGrantRepository<'c> {
|
||||
impl OAuth2AuthorizationGrantRepository for PgOAuth2AuthorizationGrantRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -251,7 +251,7 @@ impl TryInto<Client> for OAuth2ClientLookup {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> OAuth2ClientRepository for PgOAuth2ClientRepository<'c> {
|
||||
impl OAuth2ClientRepository for PgOAuth2ClientRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -138,7 +138,7 @@ impl TryFrom<OAuth2DeviceGrantLookup> for DeviceCodeGrant {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> OAuth2DeviceCodeGrantRepository for PgOAuth2DeviceCodeGrantRepository<'c> {
|
||||
impl OAuth2DeviceCodeGrantRepository for PgOAuth2DeviceCodeGrantRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -57,7 +57,7 @@ impl From<OAuth2RefreshTokenLookup> for RefreshToken {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> OAuth2RefreshTokenRepository for PgOAuth2RefreshTokenRepository<'c> {
|
||||
impl OAuth2RefreshTokenRepository for PgOAuth2RefreshTokenRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -110,7 +110,7 @@ impl TryFrom<SessionLookup> for UpstreamOAuthAuthorizationSession {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> UpstreamOAuthSessionRepository for PgUpstreamOAuthSessionRepository<'c> {
|
||||
impl UpstreamOAuthSessionRepository for PgUpstreamOAuthSessionRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -37,7 +37,7 @@ struct UserPasswordLookup {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> UserPasswordRepository for PgUserPasswordRepository<'c> {
|
||||
impl UserPasswordRepository for PgUserPasswordRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -77,7 +77,7 @@ impl From<UserRecoveryTicketRow> for UserRecoveryTicket {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<'c> UserRecoveryRepository for PgUserRecoveryRepository<'c> {
|
||||
impl UserRecoveryRepository for PgUserRecoveryRepository<'_> {
|
||||
type Error = DatabaseError;
|
||||
|
||||
#[tracing::instrument(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -56,7 +56,7 @@ where
|
||||
T: 'static,
|
||||
{
|
||||
type Iter<'a> = Box<dyn Iterator<Item = KeyValue> + '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<dyn Iterator<Item = KeyValue> + '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<std::option::IntoIter<V::Iter<'a>>>;
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user