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.87.0
ARG RUST_VERSION=1.88.0

FROM rust:$RUST_VERSION

Expand Down
2 changes: 1 addition & 1 deletion crates/crates_io_markdown/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl UrlRelativeEvaluate<'_> for SanitizeUrl {
if let Some(clean) = url.strip_prefix('#') {
// Handle auto-generated footnote links
if clean.starts_with("fn-") || clean.starts_with("fnref-") {
return Some(Cow::Owned(format!("#user-content-{}", clean)));
return Some(Cow::Owned(format!("#user-content-{clean}")));
}

// Always allow fragment URLs.
Expand Down
20 changes: 4 additions & 16 deletions crates/crates_io_smoke_test/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ impl ApiClient {
}

pub async fn load_crate<N: Display>(&self, name: N) -> anyhow::Result<CrateResponse> {
let url = format!(
"https://staging.crates.io/api/v1/crates/{}?include=versions",
name
);
let url = format!("https://staging.crates.io/api/v1/crates/{name}?include=versions");

let response = self.http_client.get(url).send().await?;
let response = response.error_for_status()?;
Expand All @@ -32,10 +29,7 @@ impl ApiClient {
name: N,
version: V,
) -> anyhow::Result<VersionResponse> {
let url = format!(
"https://staging.crates.io/api/v1/crates/{}/{}",
name, version
);
let url = format!("https://staging.crates.io/api/v1/crates/{name}/{version}");

let response = self.http_client.get(url).send().await?;
let response = response.error_for_status()?;
Expand All @@ -47,10 +41,7 @@ impl ApiClient {
name: N,
version: V,
) -> anyhow::Result<Bytes> {
let url = format!(
"https://staging.crates.io/api/v1/crates/{}/{}/download",
name, version
);
let url = format!("https://staging.crates.io/api/v1/crates/{name}/{version}/download");

let response = self.http_client.get(url).send().await?;
let response = response.error_for_status()?;
Expand All @@ -62,10 +53,7 @@ impl ApiClient {
name: N,
version: V,
) -> anyhow::Result<Bytes> {
let url = format!(
"https://static.staging.crates.io/crates/{}/{}/download",
name, version
);
let url = format!("https://static.staging.crates.io/crates/{name}/{version}/download");

let response = self.http_client.get(url).send().await?;
let response = response.error_for_status()?;
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.87.0"
channel = "1.88.0"
4 changes: 2 additions & 2 deletions src/controllers/krate/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ pub async fn publish(app: AppState, req: Parts, body: Body) -> AppResult<Json<Go
if !unknown_categories.is_empty() {
let unknown_categories = unknown_categories.join(", ");
let domain = &app.config.domain_name;
return Err(bad_request(format!("The following category slugs are not currently supported on crates.io: {}\n\nSee https://{}/category_slugs for a list of supported slugs.", unknown_categories, domain)));
return Err(bad_request(format!("The following category slugs are not currently supported on crates.io: {unknown_categories}\n\nSee https://{domain}/category_slugs for a list of supported slugs.")));
}

let top_versions = krate.top_versions(conn).await?;
Expand Down Expand Up @@ -734,7 +734,7 @@ async fn read_tarball_bytes<R: AsyncRead + Unpin>(
})?;

if tarball_len > max_length {
let message = format!("max upload size is: {}", max_length);
let message = format!("max upload size is: {max_length}");
return Err(custom(StatusCode::PAYLOAD_TOO_LARGE, message));
}

Expand Down
4 changes: 2 additions & 2 deletions src/controllers/trustpub/tokens/revoke/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn test_happy_path() -> anyhow::Result<()> {
let _token2 = new_token(&mut conn, 2).await?;
assert_compact_debug_snapshot!(all_crate_ids(&mut conn).await?, @"[[Some(1)], [Some(2)]]");

let header = format!("Bearer {}", token1);
let header = format!("Bearer {token1}");
let token_client = MockTokenUser::with_auth_header(header, app.clone());

let response = token_client.delete::<()>(URL).await;
Expand Down Expand Up @@ -129,7 +129,7 @@ async fn test_non_existent_token() -> anyhow::Result<()> {

// Generate a valid token format, but it doesn't exist in the database
let (token, _) = generate_token();
let header = format!("Bearer {}", token);
let header = format!("Bearer {token}");
let token_client = MockTokenUser::with_auth_header(header, app.clone());

// The request should succeed with 204 No Content even though the token doesn't exist
Expand Down
8 changes: 4 additions & 4 deletions src/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static EMAIL_ENV: LazyLock<Environment<'static>> = LazyLock::new(|| {
let subject_contents = std::fs::read_to_string(&subject_path).unwrap_or_else(|error| {
panic!("Failed to read subject template for {email_name}: {error}")
});
let filename = format!("{}/subject.txt.j2", email_name);
let filename = format!("{email_name}/subject.txt.j2");
env.add_template_owned(filename, subject_contents)
.expect("Failed to add subject template");

Expand All @@ -46,7 +46,7 @@ static EMAIL_ENV: LazyLock<Environment<'static>> = LazyLock::new(|| {
let body_contents = std::fs::read_to_string(&body_path).unwrap_or_else(|error| {
panic!("Failed to read body template for {email_name}: {error}")
});
let filename = format!("{}/body.txt.j2", email_name);
let filename = format!("{email_name}/body.txt.j2");
env.add_template_owned(filename, body_contents)
.expect("Failed to add body template");
}
Expand All @@ -72,8 +72,8 @@ impl EmailMessage {
template_name: &str,
context: impl Serialize,
) -> Result<Self, minijinja::Error> {
let subject = render_template(&format!("{}/subject.txt.j2", template_name), &context)?;
let body_text = render_template(&format!("{}/body.txt.j2", template_name), context)?;
let subject = render_template(&format!("{template_name}/subject.txt.j2"), &context)?;
let body_text = render_template(&format!("{template_name}/body.txt.j2"), context)?;

Ok(EmailMessage { subject, body_text })
}
Expand Down
2 changes: 1 addition & 1 deletion src/fastly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Fastly {
let path = path.trim_start_matches('/');

for domain in domains.iter() {
let url = format!("https://api.fastly.com/purge/{}/{}", domain, path);
let url = format!("https://api.fastly.com/purge/{domain}/{path}");
self.purge_url(&url).await?;
}

Expand Down
2 changes: 1 addition & 1 deletion src/tests/krate/publish/trustpub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async fn test_happy_path_with_fancy_auth_header() -> anyhow::Result<()> {

let token = new_token(&mut conn, krate.id).await?;

let header = format!("beaReR {}", token);
let header = format!("beaReR {token}");
let oidc_token_client = MockTokenUser::with_auth_header(header, app);

let pb = PublishBuilder::new(&krate.name, "1.1.0");
Expand Down
2 changes: 1 addition & 1 deletion src/tests/routes/crates/versions/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ async fn page_with_seek<U: RequestHelper>(anon: &U, url: &str) -> (Vec<VersionLi
if let Some(ref new_url) = resp.meta.next_page {
assert!(new_url.contains("seek="));
assert_that!(resp.versions, len(eq(1)));
url = Some(format!("{url_without_query}{}", new_url));
url = Some(format!("{url_without_query}{new_url}"));
assert_ne!(resp.meta.total, 0)
} else {
assert_that!(resp.versions, is_empty());
Expand Down
2 changes: 1 addition & 1 deletion src/tests/worker/sync_admins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async fn create_user(
diesel::insert_into(emails::table)
.values((
emails::user_id.eq(user_id),
emails::email.eq(format!("{}@crates.io", name)),
emails::email.eq(format!("{name}@crates.io")),
emails::verified.eq(true),
))
.execute(conn)
Expand Down
2 changes: 1 addition & 1 deletion src/worker/jobs/sync_admins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl BackgroundJob for SyncAdmins {
database_admins
.iter()
.filter(|(gh_id, _, _)| github_ids.contains(gh_id))
.map(|(gh_id, login, _)| format!("{} (github_id: {})", login, gh_id))
.map(|(gh_id, login, _)| format!("{login} (github_id: {gh_id})"))
.collect::<Vec<_>>()
};

Expand Down
Loading