diff --git a/src/db/pool.rs b/src/db/pool.rs index d3fe03a41..96ecf8b71 100644 --- a/src/db/pool.rs +++ b/src/db/pool.rs @@ -68,7 +68,7 @@ impl Pool { async move { if schema != DEFAULT_SCHEMA { conn.execute( - format!("SET search_path TO {}, {};", schema, DEFAULT_SCHEMA) + format!("SET search_path TO {schema}, {DEFAULT_SCHEMA};") .as_str(), ) .await?; diff --git a/src/db/types.rs b/src/db/types.rs index 68cc64dc3..b3728ef1e 100644 --- a/src/db/types.rs +++ b/src/db/types.rs @@ -52,7 +52,7 @@ mod tests { #[test_case(BuildStatus::InProgress, "in_progress")] fn test_build_status_serialization(status: BuildStatus, expected: &str) { let serialized = serde_json::to_string(&status).unwrap(); - assert_eq!(serialized, format!("\"{}\"", expected)); + assert_eq!(serialized, format!("\"{expected}\"")); assert_eq!( serde_json::from_str::(&serialized).unwrap(), status diff --git a/src/docbuilder/rustwide_builder.rs b/src/docbuilder/rustwide_builder.rs index 7c0971755..effb74d1f 100644 --- a/src/docbuilder/rustwide_builder.rs +++ b/src/docbuilder/rustwide_builder.rs @@ -433,7 +433,7 @@ impl RustwideBuilder { // to sentry. let mut conn = self.db.get_async().await?; - update_build_with_error(&mut conn, build_id, Some(&format!("{:?}", err))).await?; + update_build_with_error(&mut conn, build_id, Some(&format!("{err:?}"))).await?; Ok(BuildPackageSummary { successful: false, @@ -1899,8 +1899,7 @@ mod tests { let source_archive = source_archive_path(crate_, version); assert!( env.storage().exists(&source_archive)?, - "archive doesnt exist: {}", - source_archive + "archive doesnt exist: {source_archive}" ); Ok(()) diff --git a/src/repositories/gitlab.rs b/src/repositories/gitlab.rs index 79fa93c0b..bfdf82914 100644 --- a/src/repositories/gitlab.rs +++ b/src/repositories/gitlab.rs @@ -49,7 +49,7 @@ pub struct GitLab { impl GitLab { pub fn new(host: &'static str, access_token: &Option) -> Result { - Self::with_custom_endpoint(host, access_token, format!("https://{}/api/graphql", host)) + Self::with_custom_endpoint(host, access_token, format!("https://{host}/api/graphql")) } pub fn with_custom_endpoint>( diff --git a/src/storage/archive_index.rs b/src/storage/archive_index.rs index d4546e9fd..96843bf12 100644 --- a/src/storage/archive_index.rs +++ b/src/storage/archive_index.rs @@ -92,7 +92,7 @@ fn find_in_sqlite_index(conn: &Connection, search_for: &str) -> Result = storage .list_prefix(&prefix) // the result from S3 is ordered by key .await diff --git a/src/web/builds.rs b/src/web/builds.rs index cad7aabb0..0aec466ca 100644 --- a/src/web/builds.rs +++ b/src/web/builds.rs @@ -398,7 +398,7 @@ mod tests { Request::builder() .uri("/crate/foo/0.1.0/rebuild") .method("POST") - .header("Authorization", &format!("Bearer {}", correct_token)) + .header("Authorization", &format!("Bearer {correct_token}")) .body(Body::empty()) .unwrap(), ) @@ -418,7 +418,7 @@ mod tests { Request::builder() .uri("/crate/foo/0.1.0/rebuild") .method("POST") - .header("Authorization", &format!("Bearer {}", correct_token)) + .header("Authorization", &format!("Bearer {correct_token}")) .body(Body::empty()) .unwrap(), ) diff --git a/src/web/crate_details.rs b/src/web/crate_details.rs index 61f51027e..e0fae9766 100644 --- a/src/web/crate_details.rs +++ b/src/web/crate_details.rs @@ -633,9 +633,9 @@ pub(crate) async fn get_all_releases( .ok_or_else(|| anyhow!("empty target name for succesful release"))?; let inner_path = if inner_path.is_empty() { - format!("{}/index.html", target_name) + format!("{target_name}/index.html") } else { - format!("{}/{inner_path}", target_name) + format!("{target_name}/{inner_path}") }; let target = if target.is_empty() { diff --git a/src/web/extractors.rs b/src/web/extractors.rs index b0d06641e..d43da55d2 100644 --- a/src/web/extractors.rs +++ b/src/web/extractors.rs @@ -167,11 +167,11 @@ mod tests { ) .route( "/optional/something.pdf", - get(|ext: Option| async move { format!("option: {:?}", ext) }), + get(|ext: Option| async move { format!("option: {ext:?}") }), ) .route( "/optional_missing/something", - get(|ext: Option| async move { format!("option: {:?}", ext) }), + get(|ext: Option| async move { format!("option: {ext:?}") }), ); let res = app.get("/mandatory/something.pdf").await?; diff --git a/src/web/page/templates.rs b/src/web/page/templates.rs index cca91edb8..21db855ee 100644 --- a/src/web/page/templates.rs +++ b/src/web/page/templates.rs @@ -209,10 +209,7 @@ pub mod filters { ) -> askama::Result> { let highlighted_code = crate::web::highlight::with_lang(Some(lang), &code.to_string(), None); - Ok(Safe(format!( - "
{}
", - highlighted_code - ))) + Ok(Safe(format!("
{highlighted_code}
"))) } pub fn round(value: &f32, _: &dyn Values, precision: u32) -> askama::Result { diff --git a/src/web/releases.rs b/src/web/releases.rs index a4eec4065..6cbc6eecf 100644 --- a/src/web/releases.rs +++ b/src/web/releases.rs @@ -2174,7 +2174,7 @@ mod tests { env.fake_release() .await .name("failed") - .version(&format!("0.0.{}", i)) + .version(&format!("0.0.{i}")) .build_result_failed() .create() .await?; diff --git a/src/web/rustdoc.rs b/src/web/rustdoc.rs index 1a2e98598..47ef9fc81 100644 --- a/src/web/rustdoc.rs +++ b/src/web/rustdoc.rs @@ -788,7 +788,7 @@ pub(crate) async fn target_redirect_handler( Ok(axum_cached_redirect( axum_parse_uri_with_params( - &encode_url_path(&format!("/{name}/{}/{redirect_path}", req_version)), + &encode_url_path(&format!("/{name}/{req_version}/{redirect_path}")), query_args, )?, if req_version.is_latest() {