Skip to content

Commit e6d41b4

Browse files
sypharGuillaumeGomez
authored andcommitted
fix new clippy errors
1 parent ff5ebf0 commit e6d41b4

File tree

12 files changed

+16
-20
lines changed

12 files changed

+16
-20
lines changed

src/db/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl Pool {
6868
async move {
6969
if schema != DEFAULT_SCHEMA {
7070
conn.execute(
71-
format!("SET search_path TO {}, {};", schema, DEFAULT_SCHEMA)
71+
format!("SET search_path TO {schema}, {DEFAULT_SCHEMA};")
7272
.as_str(),
7373
)
7474
.await?;

src/db/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mod tests {
5252
#[test_case(BuildStatus::InProgress, "in_progress")]
5353
fn test_build_status_serialization(status: BuildStatus, expected: &str) {
5454
let serialized = serde_json::to_string(&status).unwrap();
55-
assert_eq!(serialized, format!("\"{}\"", expected));
55+
assert_eq!(serialized, format!("\"{expected}\""));
5656
assert_eq!(
5757
serde_json::from_str::<BuildStatus>(&serialized).unwrap(),
5858
status

src/docbuilder/rustwide_builder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl RustwideBuilder {
433433
// to sentry.
434434
let mut conn = self.db.get_async().await?;
435435

436-
update_build_with_error(&mut conn, build_id, Some(&format!("{:?}", err))).await?;
436+
update_build_with_error(&mut conn, build_id, Some(&format!("{err:?}"))).await?;
437437

438438
Ok(BuildPackageSummary {
439439
successful: false,
@@ -1899,8 +1899,7 @@ mod tests {
18991899
let source_archive = source_archive_path(crate_, version);
19001900
assert!(
19011901
env.storage().exists(&source_archive)?,
1902-
"archive doesnt exist: {}",
1903-
source_archive
1902+
"archive doesnt exist: {source_archive}"
19041903
);
19051904

19061905
Ok(())

src/repositories/gitlab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct GitLab {
4949

5050
impl GitLab {
5151
pub fn new(host: &'static str, access_token: &Option<String>) -> Result<Self> {
52-
Self::with_custom_endpoint(host, access_token, format!("https://{}/api/graphql", host))
52+
Self::with_custom_endpoint(host, access_token, format!("https://{host}/api/graphql"))
5353
}
5454

5555
pub fn with_custom_endpoint<E: AsRef<str>>(

src/storage/archive_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn find_in_sqlite_index(conn: &Connection, search_for: &str) -> Result<Option<Fi
9292
rusqlite::Error::FromSqlConversionFailure(
9393
2,
9494
rusqlite::types::Type::Integer,
95-
format!("invalid compression algorithm '{}' in database", value).into(),
95+
format!("invalid compression algorithm '{value}' in database").into(),
9696
)
9797
})?,
9898
})

src/web/build_details.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub(crate) async fn build_details_handler(
9999
// For a long time only for one target, then we started storing the logs for other targets
100100
// toFor a long time only for one target, then we started storing the logs for other
101101
// targets. In any case, all the logfiles are put into a folder we can just query.
102-
let prefix = format!("build-logs/{}/", id);
102+
let prefix = format!("build-logs/{id}/");
103103
let all_log_filenames: Vec<_> = storage
104104
.list_prefix(&prefix) // the result from S3 is ordered by key
105105
.await

src/web/builds.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ mod tests {
398398
Request::builder()
399399
.uri("/crate/foo/0.1.0/rebuild")
400400
.method("POST")
401-
.header("Authorization", &format!("Bearer {}", correct_token))
401+
.header("Authorization", &format!("Bearer {correct_token}"))
402402
.body(Body::empty())
403403
.unwrap(),
404404
)
@@ -418,7 +418,7 @@ mod tests {
418418
Request::builder()
419419
.uri("/crate/foo/0.1.0/rebuild")
420420
.method("POST")
421-
.header("Authorization", &format!("Bearer {}", correct_token))
421+
.header("Authorization", &format!("Bearer {correct_token}"))
422422
.body(Body::empty())
423423
.unwrap(),
424424
)

src/web/crate_details.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,9 @@ pub(crate) async fn get_all_releases(
633633
.ok_or_else(|| anyhow!("empty target name for succesful release"))?;
634634

635635
let inner_path = if inner_path.is_empty() {
636-
format!("{}/index.html", target_name)
636+
format!("{target_name}/index.html")
637637
} else {
638-
format!("{}/{inner_path}", target_name)
638+
format!("{target_name}/{inner_path}")
639639
};
640640

641641
let target = if target.is_empty() {

src/web/extractors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ mod tests {
167167
)
168168
.route(
169169
"/optional/something.pdf",
170-
get(|ext: Option<PathFileExtension>| async move { format!("option: {:?}", ext) }),
170+
get(|ext: Option<PathFileExtension>| async move { format!("option: {ext:?}") }),
171171
)
172172
.route(
173173
"/optional_missing/something",
174-
get(|ext: Option<PathFileExtension>| async move { format!("option: {:?}", ext) }),
174+
get(|ext: Option<PathFileExtension>| async move { format!("option: {ext:?}") }),
175175
);
176176

177177
let res = app.get("/mandatory/something.pdf").await?;

src/web/page/templates.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,7 @@ pub mod filters {
209209
) -> askama::Result<Safe<String>> {
210210
let highlighted_code =
211211
crate::web::highlight::with_lang(Some(lang), &code.to_string(), None);
212-
Ok(Safe(format!(
213-
"<pre><code>{}</code></pre>",
214-
highlighted_code
215-
)))
212+
Ok(Safe(format!("<pre><code>{highlighted_code}</code></pre>")))
216213
}
217214

218215
pub fn round(value: &f32, _: &dyn Values, precision: u32) -> askama::Result<String> {

0 commit comments

Comments
 (0)