diff --git a/backend.Dockerfile b/backend.Dockerfile index dd7282bf82..4dc658751f 100644 --- a/backend.Dockerfile +++ b/backend.Dockerfile @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=rust lookupName=rust-lang/rust -ARG RUST_VERSION=1.82.0 +ARG RUST_VERSION=1.83.0 FROM rust:$RUST_VERSION diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2e2b8c8521..0193dee360 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.82.0" +channel = "1.83.0" diff --git a/src/controllers/krate/versions.rs b/src/controllers/krate/versions.rs index 0caa32c941..4376101612 100644 --- a/src/controllers/krate/versions.rs +++ b/src/controllers/krate/versions.rs @@ -173,12 +173,12 @@ async fn list_by_date( /// Seek-based pagination of versions by semver /// +/// Unfortunately, Heroku Postgres has no support for the semver PG extension. +/// Therefore, we need to perform both sorting and pagination manually on the server. +/// /// # Panics /// /// This function will panic if `option` is built with `enable_pages` set to true. - -// Unfortunately, Heroku Postgres has no support for the semver PG extension. -// Therefore, we need to perform both sorting and pagination manually on the server. async fn list_by_semver( crate_id: i32, options: Option<&PaginationOptions>, diff --git a/src/controllers/token.rs b/src/controllers/token.rs index bc3825eab5..8f6a4d2c30 100644 --- a/src/controllers/token.rs +++ b/src/controllers/token.rs @@ -214,7 +214,7 @@ struct NewTokenEmail<'a> { domain: &'a str, } -impl<'a> crate::email::Email for NewTokenEmail<'a> { +impl crate::email::Email for NewTokenEmail<'_> { fn subject(&self) -> String { format!("crates.io: New API token \"{}\" created", self.token_name) } diff --git a/src/controllers/user/session.rs b/src/controllers/user/session.rs index 91a369e111..e555573a1e 100644 --- a/src/controllers/user/session.rs +++ b/src/controllers/user/session.rs @@ -91,7 +91,7 @@ pub async fn authorize( // Make sure that the state we just got matches the session state that we // should have issued earlier. let session_state = session.remove("github_oauth_state").map(CsrfToken::new); - if !session_state.is_some_and(|state| query.state.secret() == state.secret()) { + if session_state.is_none_or(|state| query.state.secret() != state.secret()) { return Err(bad_request("invalid state parameter")); } diff --git a/src/middleware/update_metrics.rs b/src/middleware/update_metrics.rs index 2d979916be..e74ec75d86 100644 --- a/src/middleware/update_metrics.rs +++ b/src/middleware/update_metrics.rs @@ -51,7 +51,7 @@ impl<'a> GaugeGuard<'a> { } } -impl<'a> Drop for GaugeGuard<'a> { +impl Drop for GaugeGuard<'_> { fn drop(&mut self) { self.gauge.dec(); } diff --git a/src/models/token/scopes.rs b/src/models/token/scopes.rs index 8c426cc871..a3b9579935 100644 --- a/src/models/token/scopes.rs +++ b/src/models/token/scopes.rs @@ -116,10 +116,10 @@ impl CrateScope { return true; } - return match self.pattern.strip_suffix('*') { + match self.pattern.strip_suffix('*') { Some(prefix) => crate_name.starts_with(prefix), None => crate_name == self.pattern, - }; + } } } diff --git a/src/real_ip.rs b/src/real_ip.rs index 24edbf89bb..111ac39edb 100644 --- a/src/real_ip.rs +++ b/src/real_ip.rs @@ -46,7 +46,7 @@ pub fn process_xff_headers(headers: &HeaderMap) -> Option { }; let has_more_headers = xff_iter.next().is_some(); - return if has_more_headers { + if has_more_headers { // This only happens for requests going directly to crates-io.herokuapp.com, // since AWS CloudFront automatically merges these headers into one. // @@ -81,7 +81,7 @@ pub fn process_xff_headers(headers: &HeaderMap) -> Option { .filter_map(|r| r.ok()) .filter(|ip| !is_cloud_front_ip(ip)) .next_back() - }; + } } /// Parses the content of an `X-Forwarded-For` header into a diff --git a/src/worker/jobs/expiry_notification.rs b/src/worker/jobs/expiry_notification.rs index a578c77e06..d622c52517 100644 --- a/src/worker/jobs/expiry_notification.rs +++ b/src/worker/jobs/expiry_notification.rs @@ -137,7 +137,7 @@ struct ExpiryNotificationEmail<'a> { expiry_date: chrono::DateTime, } -impl<'a> Email for ExpiryNotificationEmail<'a> { +impl Email for ExpiryNotificationEmail<'_> { fn subject(&self) -> String { format!( "crates.io: Your API token \"{}\" is about to expire",