Skip to content

Commit 9021ebe

Browse files
committed
Upgrade to Rust 1.83.0 and fix new warnings
1 parent 42934d3 commit 9021ebe

File tree

34 files changed

+52
-54
lines changed

34 files changed

+52
-54
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ jobs:
195195

196196
- name: Install toolchain
197197
run: |
198-
rustup toolchain install 1.82.0
199-
rustup default 1.82.0
198+
rustup toolchain install 1.83.0
199+
rustup default 1.83.0
200200
rustup component add clippy
201201
202202
- name: Setup OPA

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
# The Debian version and version name must be in sync
99
ARG DEBIAN_VERSION=12
1010
ARG DEBIAN_VERSION_NAME=bookworm
11-
ARG RUSTC_VERSION=1.82.0
11+
ARG RUSTC_VERSION=1.83.0
1212
ARG NODEJS_VERSION=20.15.0
1313
ARG OPA_VERSION=0.64.1
14-
ARG CARGO_AUDITABLE_VERSION=0.6.4
15-
ARG CARGO_CHEF_VERSION=0.1.67
14+
ARG CARGO_AUDITABLE_VERSION=0.6.6
15+
ARG CARGO_CHEF_VERSION=0.1.68
1616

1717
##########################################
1818
## Build stage that builds the frontend ##

crates/i18n-scan/src/minijinja.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn find_in_stmt<'a>(context: &mut Context, stmt: &'a Stmt<'a>) -> Result<(),
1919
Stmt::EmitRaw(_raw) => {}
2020
Stmt::ForLoop(for_loop) => {
2121
find_in_expr(context, &for_loop.iter)?;
22-
find_in_optional_expr(context, &for_loop.filter_expr)?;
22+
find_in_optional_expr(context, for_loop.filter_expr.as_ref())?;
2323
find_in_expr(context, &for_loop.target)?;
2424
find_in_stmts(context, &for_loop.body)?;
2525
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<(),
6666
find_in_expr(context, &from_import.expr)?;
6767
for (name, alias) in &from_import.names {
6868
find_in_expr(context, name)?;
69-
find_in_optional_expr(context, alias)?;
69+
find_in_optional_expr(context, alias.as_ref())?;
7070
}
7171
}
7272
Stmt::Extends(extends) => {
@@ -185,9 +185,9 @@ fn find_in_expr<'a>(context: &mut Context, expr: &'a Expr<'a>) -> Result<(), min
185185
Expr::Const(_const) => {}
186186
Expr::Slice(slice) => {
187187
find_in_expr(context, &slice.expr)?;
188-
find_in_optional_expr(context, &slice.start)?;
189-
find_in_optional_expr(context, &slice.stop)?;
190-
find_in_optional_expr(context, &slice.step)?;
188+
find_in_optional_expr(context, slice.start.as_ref())?;
189+
find_in_optional_expr(context, slice.stop.as_ref())?;
190+
find_in_optional_expr(context, slice.step.as_ref())?;
191191
}
192192
Expr::UnaryOp(unary_op) => {
193193
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
199199
Expr::IfExpr(if_expr) => {
200200
find_in_expr(context, &if_expr.test_expr)?;
201201
find_in_expr(context, &if_expr.true_expr)?;
202-
find_in_optional_expr(context, &if_expr.false_expr)?;
202+
find_in_optional_expr(context, if_expr.false_expr.as_ref())?;
203203
}
204204
Expr::Filter(filter) => {
205-
find_in_optional_expr(context, &filter.expr)?;
205+
find_in_optional_expr(context, filter.expr.as_ref())?;
206206
find_in_call_args(context, &filter.args)?;
207207
}
208208
Expr::Test(test) => {
@@ -241,7 +241,7 @@ fn find_in_exprs<'a>(context: &mut Context, exprs: &'a [Expr<'a>]) -> Result<(),
241241

242242
fn find_in_optional_expr<'a>(
243243
context: &mut Context,
244-
expr: &'a Option<Expr<'a>>,
244+
expr: Option<&'a Expr<'a>>,
245245
) -> Result<(), minijinja::Error> {
246246
if let Some(expr) = expr {
247247
find_in_expr(context, expr)?;

crates/i18n/src/sprintf/formatter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ pub enum FormattedMessagePart<'a> {
483483
Placeholder(String),
484484
}
485485

486-
impl<'a> FormattedMessagePart<'a> {
486+
impl FormattedMessagePart<'_> {
487487
fn len(&self) -> usize {
488488
match self {
489489
FormattedMessagePart::Text(text) => text.len(),

crates/jose/src/claims.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ impl<'a> TokenHash<'a> {
334334
}
335335
}
336336

337-
impl<'a> Validator<String> for TokenHash<'a> {
337+
impl Validator<String> for TokenHash<'_> {
338338
type Error = TokenHashError;
339339
fn validate(&self, value: &String) -> Result<(), Self::Error> {
340340
if hash_token(self.alg, self.token)? == *value {
@@ -362,7 +362,7 @@ impl<'a, T: ?Sized> Equality<'a, T> {
362362
}
363363
}
364364

365-
impl<'a, T1, T2> Validator<T1> for Equality<'a, T2>
365+
impl<T1, T2> Validator<T1> for Equality<'_, T2>
366366
where
367367
T2: PartialEq<T1> + ?Sized,
368368
{
@@ -399,7 +399,7 @@ impl<'a, T> Contains<'a, T> {
399399
#[error("OneOrMany doesn't contain value")]
400400
pub struct ContainsError;
401401

402-
impl<'a, T> Validator<OneOrMany<T>> for Contains<'a, T>
402+
impl<T> Validator<OneOrMany<T>> for Contains<'_, T>
403403
where
404404
T: PartialEq,
405405
{

crates/jose/src/constraints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub trait Constrainable {
9191
fn kty(&self) -> JsonWebKeyType;
9292
}
9393

94-
impl<'a> Constraint<'a> {
94+
impl Constraint<'_> {
9595
fn decide<T: Constrainable>(&self, constrainable: &T) -> ConstraintDecision {
9696
match self {
9797
Constraint::Alg { constraint_alg } => {

crates/jose/src/jwt/raw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl RawJwt<'static> {
2525
}
2626
}
2727

28-
impl<'a> std::fmt::Display for RawJwt<'a> {
28+
impl std::fmt::Display for RawJwt<'_> {
2929
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3030
write!(f, "{}", self.inner)
3131
}
@@ -57,7 +57,7 @@ impl<'a> RawJwt<'a> {
5757
}
5858
}
5959

60-
impl<'a> Deref for RawJwt<'a> {
60+
impl Deref for RawJwt<'_> {
6161
type Target = str;
6262

6363
fn deref(&self) -> &Self::Target {

crates/jose/src/jwt/signed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ pub struct Jwt<'a, T> {
2121
signature: Vec<u8>,
2222
}
2323

24-
impl<'a, T> std::fmt::Display for Jwt<'a, T> {
24+
impl<T> std::fmt::Display for Jwt<'_, T> {
2525
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2626
write!(f, "{}", self.raw)
2727
}
2828
}
2929

30-
impl<'a, T> std::fmt::Debug for Jwt<'a, T>
30+
impl<T> std::fmt::Debug for Jwt<'_, T>
3131
where
3232
T: std::fmt::Debug,
3333
{

crates/keystore/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,9 @@ impl PrivateKey {
354354
pkcs8::EncryptedPrivateKeyInfo::PEM_LABEL => {
355355
let info = pkcs8::EncryptedPrivateKeyInfo::from_der(&doc)?;
356356
let decrypted = info.decrypt(password)?;
357-
return Self::load_der(decrypted.as_bytes()).map_err(|inner| {
358-
LoadError::InEncrypted {
359-
inner: Box::new(inner),
360-
}
361-
});
357+
Self::load_der(decrypted.as_bytes()).map_err(|inner| LoadError::InEncrypted {
358+
inner: Box::new(inner),
359+
})
362360
}
363361

364362
pkcs1::RsaPrivateKey::PEM_LABEL

crates/spa/src/vite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl Manifest {
229229
&'a self,
230230
current_entry: &'a ManifestEntry,
231231
entries: &mut BTreeSet<Asset<'a>>,
232-
) -> Result<Asset, InvalidManifest<'a>> {
232+
) -> Result<Asset<'a>, InvalidManifest<'a>> {
233233
let asset = Asset::new(current_entry)?;
234234
let inserted = entries.insert(asset);
235235

0 commit comments

Comments
 (0)