Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend.Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.82.0"
channel = "1.83.0"
6 changes: 3 additions & 3 deletions src/controllers/krate/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/user/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
2 changes: 1 addition & 1 deletion src/middleware/update_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/token/scopes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/real_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn process_xff_headers(headers: &HeaderMap) -> Option<IpAddr> {
};

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.
//
Expand Down Expand Up @@ -81,7 +81,7 @@ pub fn process_xff_headers(headers: &HeaderMap) -> Option<IpAddr> {
.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
Expand Down
2 changes: 1 addition & 1 deletion src/worker/jobs/expiry_notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct ExpiryNotificationEmail<'a> {
expiry_date: chrono::DateTime<chrono::Utc>,
}

impl<'a> Email for ExpiryNotificationEmail<'a> {
impl Email for ExpiryNotificationEmail<'_> {
fn subject(&self) -> String {
format!(
"crates.io: Your API token \"{}\" is about to expire",
Expand Down
Loading