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 src/db/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
2 changes: 1 addition & 1 deletion src/db/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<BuildStatus>(&serialized).unwrap(),
status
Expand Down
5 changes: 2 additions & 3 deletions src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(())
Expand Down
2 changes: 1 addition & 1 deletion src/repositories/gitlab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct GitLab {

impl GitLab {
pub fn new(host: &'static str, access_token: &Option<String>) -> Result<Self> {
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<E: AsRef<str>>(
Expand Down
2 changes: 1 addition & 1 deletion src/storage/archive_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn find_in_sqlite_index(conn: &Connection, search_for: &str) -> Result<Option<Fi
rusqlite::Error::FromSqlConversionFailure(
2,
rusqlite::types::Type::Integer,
format!("invalid compression algorithm '{}' in database", value).into(),
format!("invalid compression algorithm '{value}' in database").into(),
)
})?,
})
Expand Down
2 changes: 1 addition & 1 deletion src/web/build_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub(crate) async fn build_details_handler(
// For a long time only for one target, then we started storing the logs for other targets
// toFor a long time only for one target, then we started storing the logs for other
// targets. In any case, all the logfiles are put into a folder we can just query.
let prefix = format!("build-logs/{}/", id);
let prefix = format!("build-logs/{id}/");
let all_log_filenames: Vec<_> = storage
.list_prefix(&prefix) // the result from S3 is ordered by key
.await
Expand Down
4 changes: 2 additions & 2 deletions src/web/builds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand All @@ -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(),
)
Expand Down
4 changes: 2 additions & 2 deletions src/web/crate_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/web/extractors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ mod tests {
)
.route(
"/optional/something.pdf",
get(|ext: Option<PathFileExtension>| async move { format!("option: {:?}", ext) }),
get(|ext: Option<PathFileExtension>| async move { format!("option: {ext:?}") }),
)
.route(
"/optional_missing/something",
get(|ext: Option<PathFileExtension>| async move { format!("option: {:?}", ext) }),
get(|ext: Option<PathFileExtension>| async move { format!("option: {ext:?}") }),
);

let res = app.get("/mandatory/something.pdf").await?;
Expand Down
5 changes: 1 addition & 4 deletions src/web/page/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,7 @@ pub mod filters {
) -> askama::Result<Safe<String>> {
let highlighted_code =
crate::web::highlight::with_lang(Some(lang), &code.to_string(), None);
Ok(Safe(format!(
"<pre><code>{}</code></pre>",
highlighted_code
)))
Ok(Safe(format!("<pre><code>{highlighted_code}</code></pre>")))
}

pub fn round(value: &f32, _: &dyn Values, precision: u32) -> askama::Result<String> {
Expand Down
2 changes: 1 addition & 1 deletion src/web/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
2 changes: 1 addition & 1 deletion src/web/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading