Skip to content

Commit d11e0b2

Browse files
authored
Upgrade to Rust 1.89.0 (#4900)
2 parents e203a5f + cfb4471 commit d11e0b2

File tree

41 files changed

+239
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+239
-271
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ jobs:
215215
uses: actions/checkout@v5
216216

217217
- name: Install Rust toolchain
218-
uses: dtolnay/rust-toolchain@1.87.0
218+
uses: dtolnay/rust-toolchain@1.89.0
219219
with:
220220
components: clippy
221221

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# The Debian version and version name must be in sync
1313
ARG DEBIAN_VERSION=12
1414
ARG DEBIAN_VERSION_NAME=bookworm
15-
ARG RUSTC_VERSION=1.87.0
15+
ARG RUSTC_VERSION=1.89.0
1616
ARG NODEJS_VERSION=20.15.0
1717
ARG OPA_VERSION=1.1.0
1818
ARG CARGO_AUDITABLE_VERSION=0.6.6

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
44
# Please see LICENSE files in the repository root for full details.
55

6-
doc-valid-idents = ["OpenID", "OAuth", "..", "PostgreSQL", "SQLite"]
6+
doc-valid-idents = ["OpenID", "OAuth", "UserInfo", "..", "PostgreSQL", "SQLite"]
77

88
disallowed-methods = [
99
{ path = "rand::thread_rng", reason = "do not create rngs on the fly, pass them as parameters" },

crates/cli/build.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ fn main() -> anyhow::Result<()> {
1212
// At build time, we override the version through the environment variable
1313
// VERGEN_GIT_DESCRIBE. In some contexts, it means this variable is set but
1414
// empty, so we unset it here.
15-
if let Ok(ver) = std::env::var("VERGEN_GIT_DESCRIBE") {
16-
if ver.is_empty() {
17-
#[allow(unsafe_code)]
18-
// SAFETY: This is safe because the build script is running a single thread
19-
unsafe {
20-
std::env::remove_var("VERGEN_GIT_DESCRIBE");
21-
}
15+
if let Ok(ver) = std::env::var("VERGEN_GIT_DESCRIBE")
16+
&& ver.is_empty()
17+
{
18+
#[allow(unsafe_code)]
19+
// SAFETY: This is safe because the build script is running a single thread
20+
unsafe {
21+
std::env::remove_var("VERGEN_GIT_DESCRIBE");
2222
}
2323
}
2424

crates/cli/src/app_state.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@ fn infer_client_ip(
275275

276276
let peer = if let Some(info) = connection_info {
277277
// We can always trust the proxy protocol to give us the correct IP address
278-
if let Some(proxy) = info.get_proxy_ref() {
279-
if let Some(source) = proxy.source() {
280-
return Some(source.ip());
281-
}
278+
if let Some(proxy) = info.get_proxy_ref()
279+
&& let Some(source) = proxy.source()
280+
{
281+
return Some(source.ip());
282282
}
283283

284284
info.get_peer_addr().map(|addr| addr.ip())

crates/cli/src/commands/manage.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,12 @@ impl Options {
619619
let txn = conn.begin().await?;
620620
let mut repo = PgRepository::from_conn(txn);
621621

622-
if let Some(password) = &password {
623-
if !ignore_password_complexity
624-
&& !password_manager.is_password_complex_enough(password)?
625-
{
626-
error!("That password is too weak.");
627-
return Ok(ExitCode::from(1));
628-
}
622+
if let Some(password) = &password
623+
&& !ignore_password_complexity
624+
&& !password_manager.is_password_complex_enough(password)?
625+
{
626+
error!("That password is too weak.");
627+
return Ok(ExitCode::from(1));
629628
}
630629

631630
// If the username is provided, check if it's available and normalize it.

crates/cli/src/sync.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ pub async fn config_sync(
208208
// private key to hold the content of the private key file.
209209
// private key (raw) takes precedence so both can be defined
210210
// without issues
211-
if siwa.private_key.is_none() {
212-
if let Some(private_key_file) = siwa.private_key_file.take() {
213-
let key = tokio::fs::read_to_string(private_key_file).await?;
214-
siwa.private_key = Some(key);
215-
}
211+
if siwa.private_key.is_none()
212+
&& let Some(private_key_file) = siwa.private_key_file.take()
213+
{
214+
let key = tokio::fs::read_to_string(private_key_file).await?;
215+
siwa.private_key = Some(key);
216216
}
217217
let encoded = serde_json::to_vec(&siwa)?;
218218
Some(encrypter.encrypt_to_string(&encoded)?)

crates/config/src/sections/secrets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl KeyConfig {
149149
/// Returns the password in case any is provided.
150150
///
151151
/// If `password_file` was given, the password is read from that file.
152-
async fn password(&self) -> anyhow::Result<Option<Cow<[u8]>>> {
152+
async fn password(&self) -> anyhow::Result<Option<Cow<'_, [u8]>>> {
153153
Ok(match &self.password {
154154
Some(Password::File(path)) => Some(Cow::Owned(tokio::fs::read(path).await?)),
155155
Some(Password::Value(password)) => Some(Cow::Borrowed(password.as_bytes())),
@@ -160,7 +160,7 @@ impl KeyConfig {
160160
/// Returns the key.
161161
///
162162
/// If `key_file` was given, the key is read from that file.
163-
async fn key(&self) -> anyhow::Result<Cow<[u8]>> {
163+
async fn key(&self) -> anyhow::Result<Cow<'_, [u8]>> {
164164
Ok(match &self.key {
165165
Key::File(path) => Cow::Owned(tokio::fs::read(path).await?),
166166
Key::Value(key) => Cow::Borrowed(key.as_bytes()),

crates/config/src/sections/telemetry.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -198,34 +198,34 @@ impl ConfigurationSection for TelemetryConfig {
198198
&self,
199199
_figment: &figment::Figment,
200200
) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
201-
if let Some(sample_rate) = self.sentry.sample_rate {
202-
if !(0.0..=1.0).contains(&sample_rate) {
203-
return Err(figment::error::Error::custom(
204-
"Sentry sample rate must be between 0.0 and 1.0",
205-
)
206-
.with_path("sentry.sample_rate")
207-
.into());
208-
}
201+
if let Some(sample_rate) = self.sentry.sample_rate
202+
&& !(0.0..=1.0).contains(&sample_rate)
203+
{
204+
return Err(figment::error::Error::custom(
205+
"Sentry sample rate must be between 0.0 and 1.0",
206+
)
207+
.with_path("sentry.sample_rate")
208+
.into());
209209
}
210210

211-
if let Some(sample_rate) = self.sentry.traces_sample_rate {
212-
if !(0.0..=1.0).contains(&sample_rate) {
213-
return Err(figment::error::Error::custom(
214-
"Sentry sample rate must be between 0.0 and 1.0",
215-
)
216-
.with_path("sentry.traces_sample_rate")
217-
.into());
218-
}
211+
if let Some(sample_rate) = self.sentry.traces_sample_rate
212+
&& !(0.0..=1.0).contains(&sample_rate)
213+
{
214+
return Err(figment::error::Error::custom(
215+
"Sentry sample rate must be between 0.0 and 1.0",
216+
)
217+
.with_path("sentry.traces_sample_rate")
218+
.into());
219219
}
220220

221-
if let Some(sample_rate) = self.tracing.sample_rate {
222-
if !(0.0..=1.0).contains(&sample_rate) {
223-
return Err(figment::error::Error::custom(
224-
"Tracing sample rate must be between 0.0 and 1.0",
225-
)
226-
.with_path("tracing.sample_rate")
227-
.into());
228-
}
221+
if let Some(sample_rate) = self.tracing.sample_rate
222+
&& !(0.0..=1.0).contains(&sample_rate)
223+
{
224+
return Err(figment::error::Error::custom(
225+
"Tracing sample rate must be between 0.0 and 1.0",
226+
)
227+
.with_path("tracing.sample_rate")
228+
.into());
229229
}
230230

231231
Ok(())

crates/config/src/sections/upstream_oauth2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ pub struct Provider {
652652

653653
/// What to do when receiving an OIDC Backchannel logout request.
654654
///
655-
/// Defaults to "do_nothing".
655+
/// Defaults to `do_nothing`.
656656
#[serde(default, skip_serializing_if = "OnBackchannelLogout::is_default")]
657657
pub on_backchannel_logout: OnBackchannelLogout,
658658
}

0 commit comments

Comments
 (0)