Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
bbhtt authored and barthalion committed Sep 14, 2024
1 parent d437adb commit 8d532fa
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn load_gpg_key(
Some(gpg_key) => {
let mut cmd = Command::new("gpg2");
if let Some(gpg_homedir) = maybe_gpg_homedir {
cmd.arg(&format!("--homedir={gpg_homedir}"));
cmd.arg(format!("--homedir={gpg_homedir}"));
}
cmd.arg("--export").arg(gpg_key);

Expand Down
2 changes: 1 addition & 1 deletion src/jobs/commit_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl CommitJobInstance {
for appstream_ref in appstream_refs {
let arch = appstream_ref.split('/').nth(1).unwrap();
let mut cmd = Command::new("ostree");
cmd.arg(&format!("--repo={}", &build_repo_path.to_str().unwrap()))
cmd.arg(format!("--repo={}", &build_repo_path.to_str().unwrap()))
.arg("checkout")
.arg("--user-mode")
.arg("--union")
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/publish_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl PublishJobInstance {
&format!("extracting {}", build_ref.ref_name),
);
let mut cmd = Command::new("ostree");
cmd.arg(&format!("--repo={}", &build_repo_path.to_str().unwrap()))
cmd.arg(format!("--repo={}", &build_repo_path.to_str().unwrap()))
.arg("checkout")
.arg("--user-mode")
.arg("--bareuseronly-dirs")
Expand Down
4 changes: 2 additions & 2 deletions src/jobs/republish_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ impl JobInstance for RepublishJobInstance {
.arg("--no-update-summary")
.arg("--disable-fsync"); // No need for fsync in intermediate steps

cmd.arg(&format!(
cmd.arg(format!(
"--src-repo={}",
repoconfig
.get_abs_repo_path()
.to_str()
.expect("repo paths should be valid unicode")
))
.arg(&format!("--src-ref={ref_name}"))
.arg(format!("--src-ref={ref_name}"))
.arg(tmp_repo_dir.path())
.arg(&ref_name);

Expand Down
2 changes: 1 addition & 1 deletion src/jobs/update_repo_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl UpdateRepoJobInstance {
for appstream_ref in appstream_refs {
let arch = appstream_ref.split('/').nth(1).unwrap();
let mut cmd = Command::new("ostree");
cmd.arg(&format!("--repo={}", &repoconfig.path.to_str().unwrap()))
cmd.arg(format!("--repo={}", &repoconfig.path.to_str().unwrap()))
.arg("checkout")
.arg("--user-mode")
.arg("--union")
Expand Down
6 changes: 1 addition & 5 deletions src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ where
};

let user_agent = if let Some(val) = req.headers().get("User-Agent") {
if let Ok(s) = val.to_str() {
s
} else {
"-"
}
val.to_str().unwrap_or("-")
} else {
"-"
}
Expand Down
6 changes: 3 additions & 3 deletions src/ostree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,9 @@ pub fn pull_commit_async(
});
}

cmd.arg(&format!("--repo={}", &repo_path.to_str().unwrap()))
cmd.arg(format!("--repo={}", &repo_path.to_str().unwrap()))
.arg("pull")
.arg(&format!("--url={url}"))
.arg(format!("--url={url}"))
.arg("upstream")
.arg(&commit);

Expand Down Expand Up @@ -1060,7 +1060,7 @@ pub fn prune_async(repo_path: &Path) -> Box<dyn Future<Item = (), Error = Ostree
}

cmd.arg("prune")
.arg(&format!("--repo={}", repo_path.to_string_lossy()))
.arg(format!("--repo={}", repo_path.to_string_lossy()))
.arg("--keep-younger-than=3 days ago");

Box::new(
Expand Down

0 comments on commit 8d532fa

Please sign in to comment.