Resolves clippy errors, please review!!! (#60)

This commit is contained in:
Thomas Schönauer
2022-10-23 11:34:30 +00:00
committed by GitHub
parent 6000124062
commit 347372ca71
19 changed files with 147 additions and 140 deletions

View File

@@ -53,7 +53,7 @@ async fn pull_repository(repo: String, git: &Path, ctx: &ExecutionContext<'_>) -
command
.stdin(Stdio::null())
.current_dir(&repo)
.args(&["pull", "--ff-only"]);
.args(["pull", "--ff-only"]);
if let Some(extra_arguments) = ctx.config().git_arguments() {
command.args(extra_arguments.split_whitespace());
@@ -61,7 +61,7 @@ async fn pull_repository(repo: String, git: &Path, ctx: &ExecutionContext<'_>) -
let pull_output = command.output().await?;
let submodule_output = AsyncCommand::new(git)
.args(&["submodule", "update", "--recursive"])
.args(["submodule", "update", "--recursive"])
.current_dir(&repo)
.stdin(Stdio::null())
.output()
@@ -78,10 +78,10 @@ async fn pull_repository(repo: String, git: &Path, ctx: &ExecutionContext<'_>) -
(Some(before), Some(after)) if before != after => {
println!("{} {}:", style("Changed").yellow().bold(), &repo);
Command::new(&git)
Command::new(git)
.stdin(Stdio::null())
.current_dir(&repo)
.args(&[
.args([
"--no-pager",
"log",
"--no-decorate",
@@ -107,7 +107,7 @@ fn get_head_revision(git: &Path, repo: &str) -> Option<String> {
Command::new(git)
.stdin(Stdio::null())
.current_dir(repo)
.args(&["rev-parse", "HEAD"])
.args(["rev-parse", "HEAD"])
.check_output()
.map(|output| output.trim().to_string())
.map_err(|e| {
@@ -122,7 +122,7 @@ fn has_remotes(git: &Path, repo: &str) -> Option<bool> {
Command::new(git)
.stdin(Stdio::null())
.current_dir(repo)
.args(&["remote", "show"])
.args(["remote", "show"])
.check_output()
.map(|output| output.lines().count() > 0)
.map_err(|e| {
@@ -162,10 +162,10 @@ impl Git {
};
if let Some(git) = &self.git {
let output = Command::new(&git)
let output = Command::new(git)
.stdin(Stdio::null())
.current_dir(path)
.args(&["rev-parse", "--show-toplevel"])
.args(["rev-parse", "--show-toplevel"])
.check_output()
.ok()
.map(|output| output.trim().to_string());
@@ -231,7 +231,8 @@ impl Git {
let results = basic_rt.block_on(async { stream_of_futures.collect::<Vec<Result<()>>>().await });
let error = results.into_iter().find(|r| r.is_err());
error.unwrap_or(Ok(()))
error.unwrap()?;
Ok(())
}
}