Skip to content

Commit 154e42a

Browse files
committed
Upgrade Rust to 1.84 and fix new clippy lints
1 parent 8ac49ae commit 154e42a

File tree

10 files changed

+46
-46
lines changed

10 files changed

+46
-46
lines changed

.github/workflows/ci.yaml

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

226226
- name: Install toolchain
227227
run: |
228-
rustup toolchain install 1.83.0
229-
rustup default 1.83.0
228+
rustup toolchain install 1.84.0
229+
rustup default 1.84.0
230230
rustup component add clippy
231231
232232
- name: Setup OPA

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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.83.0
11+
ARG RUSTC_VERSION=1.84.0
1212
ARG NODEJS_VERSION=20.15.0
1313
ARG OPA_VERSION=0.64.1
1414
ARG CARGO_AUDITABLE_VERSION=0.6.6

crates/cli/src/commands/doctor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ See {DOCS_BASE}/setup/homeserver.html",
4747

4848
if !issuer.starts_with("https://") {
4949
warn!(
50-
r#"⚠️ The issuer in the config (`http.issuer`/`http.public_base`) is not an HTTPS URL.
51-
This means some clients will refuse to use it."#
50+
r"⚠️ The issuer in the config (`http.issuer`/`http.public_base`) is not an HTTPS URL.
51+
This means some clients will refuse to use it."
5252
);
5353
}
5454

crates/handlers/src/upstream_oauth2/cache.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ impl<'a> LazyProviderInfos<'a> {
4141

4242
/// Trigger the discovery process and return the metadata if discovery is
4343
/// enabled.
44-
pub async fn maybe_discover<'b>(
45-
&'b mut self,
46-
) -> Result<Option<&'b VerifiedProviderMetadata>, DiscoveryError> {
44+
pub async fn maybe_discover(
45+
&mut self,
46+
) -> Result<Option<&VerifiedProviderMetadata>, DiscoveryError> {
4747
match self.load().await {
4848
Ok(metadata) => Ok(Some(metadata)),
4949
Err(DiscoveryError::Disabled) => Ok(None),
5050
Err(e) => Err(e),
5151
}
5252
}
5353

54-
async fn load<'b>(&'b mut self) -> Result<&'b VerifiedProviderMetadata, DiscoveryError> {
54+
async fn load(&mut self) -> Result<&VerifiedProviderMetadata, DiscoveryError> {
5555
if self.loaded_metadata.is_none() {
5656
let verify = match self.provider.discovery_mode {
5757
UpstreamOAuthProviderDiscoveryMode::Oidc => true,

crates/handlers/src/upstream_oauth2/link.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ pub(crate) async fn get(
429429
let ctx = ErrorContext::new()
430430
.with_code("User exists")
431431
.with_description(format!(
432-
r#"Upstream account provider returned {localpart:?} as username,
433-
which is not linked to that upstream account"#
432+
r"Upstream account provider returned {localpart:?} as username,
433+
which is not linked to that upstream account"
434434
))
435435
.with_language(&locale);
436436

@@ -449,8 +449,8 @@ pub(crate) async fn get(
449449
let ctx = ErrorContext::new()
450450
.with_code("Policy error")
451451
.with_description(format!(
452-
r#"Upstream account provider returned {localpart:?} as username,
453-
which does not pass the policy check: {res}"#
452+
r"Upstream account provider returned {localpart:?} as username,
453+
which does not pass the policy check: {res}"
454454
))
455455
.with_language(&locale);
456456

@@ -593,7 +593,7 @@ pub(crate) async fn post(
593593
// Is the email verified according to the upstream provider?
594594
let provider_email_verified = env
595595
.render_str("{{ user.email_verified | string }}", &context)
596-
.map_or(false, |v| v == "true");
596+
.is_ok_and(|v| v == "true");
597597

598598
// Create a template context in case we need to re-render because of an error
599599
let ctx = UpstreamRegister::new(link.clone(), provider.clone());

crates/iana-codegen/src/gen.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@ pub fn struct_def(
2222
) -> std::fmt::Result {
2323
write!(
2424
f,
25-
r#"/// {}
25+
r"/// {}
2626
///
2727
/// Source: <{}>
28-
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]"#,
28+
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]",
2929
section.doc,
3030
section.url.unwrap(),
3131
)?;
3232

3333
if !is_exhaustive {
3434
write!(
3535
f,
36-
r#"
37-
#[non_exhaustive]"#
36+
r"
37+
#[non_exhaustive]"
3838
)?;
3939
}
4040

4141
write!(
4242
f,
43-
r#"
44-
pub enum {} {{"#,
43+
r"
44+
pub enum {} {{",
4545
section.key,
4646
)?;
4747
for member in list {
@@ -72,9 +72,9 @@ pub fn display_impl(
7272
) -> std::fmt::Result {
7373
write!(
7474
f,
75-
r#"impl core::fmt::Display for {} {{
75+
r"impl core::fmt::Display for {} {{
7676
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {{
77-
match self {{"#,
77+
match self {{",
7878
section.key,
7979
)?;
8080

@@ -97,10 +97,10 @@ pub fn display_impl(
9797

9898
writeln!(
9999
f,
100-
r#"
100+
r"
101101
}}
102102
}}
103-
}}"#,
103+
}}",
104104
)
105105
}
106106

@@ -117,11 +117,11 @@ pub fn from_str_impl(
117117
};
118118
write!(
119119
f,
120-
r#"impl core::str::FromStr for {} {{
120+
r"impl core::str::FromStr for {} {{
121121
type Err = {err_ty};
122122
123123
fn from_str(s: &str) -> Result<Self, Self::Err> {{
124-
match s {{"#,
124+
match s {{",
125125
section.key,
126126
)?;
127127

@@ -137,23 +137,23 @@ pub fn from_str_impl(
137137
if is_exhaustive {
138138
write!(
139139
f,
140-
r#"
141-
_ => Err(crate::ParseError::new()),"#
140+
r"
141+
_ => Err(crate::ParseError::new()),"
142142
)?;
143143
} else {
144144
write!(
145145
f,
146-
r#"
147-
value => Ok(Self::Unknown(value.to_owned())),"#,
146+
r"
147+
value => Ok(Self::Unknown(value.to_owned())),",
148148
)?;
149149
}
150150

151151
writeln!(
152152
f,
153-
r#"
153+
r"
154154
}}
155155
}}
156-
}}"#,
156+
}}",
157157
)
158158
}
159159

@@ -179,22 +179,22 @@ impl schemars::JsonSchema for {} {{
179179
for member in list {
180180
write!(
181181
f,
182-
r#"
182+
r"
183183
// ---
184-
schemars::schema::SchemaObject {{"#,
184+
schemars::schema::SchemaObject {{",
185185
)?;
186186

187187
if let Some(description) = &member.description {
188188
write!(
189189
f,
190-
r#"
190+
r"
191191
metadata: Some(Box::new(schemars::schema::Metadata {{
192192
description: Some(
193193
// ---
194194
{}.to_owned(),
195195
),
196196
..Default::default()
197-
}})),"#,
197+
}})),",
198198
raw_string(description),
199199
)?;
200200
}
@@ -212,7 +212,7 @@ impl schemars::JsonSchema for {} {{
212212

213213
writeln!(
214214
f,
215-
r#"
215+
r"
216216
];
217217
218218
let description = {};
@@ -229,7 +229,7 @@ impl schemars::JsonSchema for {} {{
229229
}}
230230
.into()
231231
}}
232-
}}"#,
232+
}}",
233233
raw_string(section.doc),
234234
)
235235
}

crates/iana-codegen/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl Display for File {
7575
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7676
writeln!(
7777
f,
78-
r#"// Copyright 2024 New Vector Ltd.
78+
r"// Copyright 2024 New Vector Ltd.
7979
// Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
8080
//
8181
// SPDX-License-Identifier: AGPL-3.0-only
@@ -86,7 +86,7 @@ impl Display for File {
8686
//! Enums from the {:?} IANA registry
8787
//! See <{}>
8888
89-
// Do not edit this file manually"#,
89+
// Do not edit this file manually",
9090
self.registry_name, self.registry_url,
9191
)?;
9292

crates/listener/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ where
217217
let tls = stream.tls_info();
218218

219219
// Figure out if it's HTTP/2 based on the negociated ALPN info
220-
let is_h2 = tls.as_ref().map_or(false, TlsStreamInfo::is_alpn_h2);
220+
let is_h2 = tls.as_ref().is_some_and(TlsStreamInfo::is_alpn_h2);
221221

222222
let info = ConnectionInfo {
223223
tls,
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/src/queue/schedule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl QueueScheduleRepository for PgQueueScheduleRepository<'_> {
6969
ScheduleLookup,
7070
r#"
7171
SELECT
72-
queue_schedules.schedule_name,
72+
queue_schedules.schedule_name as "schedule_name!",
7373
queue_schedules.last_scheduled_at,
7474
queue_jobs.status IN ('completed', 'failed') as last_scheduled_job_completed
7575
FROM queue_schedules

0 commit comments

Comments
 (0)