mirror of
https://github.com/Noratrieb/website.git
synced 2026-01-14 17:05:02 +01:00
clippy fix
This commit is contained in:
parent
2da77e8af5
commit
d0b410a6b3
4 changed files with 14 additions and 14 deletions
|
|
@ -11,14 +11,14 @@ pub fn build(blog: &Path, dist: &Path) -> Result<()> {
|
|||
|
||||
utils::run_process(
|
||||
Command::new("git")
|
||||
.args(&["submodule", "init"])
|
||||
.current_dir(&blog),
|
||||
.args(["submodule", "init"])
|
||||
.current_dir(blog),
|
||||
)?;
|
||||
|
||||
utils::run_process(
|
||||
Command::new("git")
|
||||
.args(&["submodule", "update"])
|
||||
.current_dir(&blog),
|
||||
.args(["submodule", "update"])
|
||||
.current_dir(blog),
|
||||
)?;
|
||||
|
||||
// Patch config
|
||||
|
|
@ -29,8 +29,8 @@ pub fn build(blog: &Path, dist: &Path) -> Result<()> {
|
|||
|
||||
utils::run_process(
|
||||
Command::new("hugo")
|
||||
.args(&["--minify", "--destination", dist.to_str().unwrap()])
|
||||
.current_dir(&blog),
|
||||
.args(["--minify", "--destination", dist.to_str().unwrap()])
|
||||
.current_dir(blog),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ impl Talk {
|
|||
format!(
|
||||
"{}-{}",
|
||||
self.date,
|
||||
self.name.replace(" ", "-").to_lowercase()
|
||||
self.name.replace(' ', "-").to_lowercase()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ pub fn sync(path: &Path, config: &Submodules) -> color_eyre::Result<()> {
|
|||
if !sub_path.exists() {
|
||||
info!(?name, ?url, "Cloning");
|
||||
let mut cmd = process::Command::new("git");
|
||||
cmd.args(&["clone", url, sub_path.to_str().unwrap()]);
|
||||
cmd.args(["clone", url, sub_path.to_str().unwrap()]);
|
||||
utils::run_process(&mut cmd)?;
|
||||
} else {
|
||||
debug!(?name, ?url, "Repo already exists");
|
||||
|
|
@ -97,7 +97,7 @@ pub fn sync(path: &Path, config: &Submodules) -> color_eyre::Result<()> {
|
|||
|
||||
let current_commit = utils::run_process(
|
||||
process::Command::new("git")
|
||||
.args(&["rev-parse", "HEAD"])
|
||||
.args(["rev-parse", "HEAD"])
|
||||
.current_dir(&sub_path),
|
||||
)
|
||||
.wrap_err("running git rev-parse HEAD")?;
|
||||
|
|
@ -108,19 +108,19 @@ pub fn sync(path: &Path, config: &Submodules) -> color_eyre::Result<()> {
|
|||
info!("Need to change commit");
|
||||
let commit_exists = utils::run_process(
|
||||
process::Command::new("git")
|
||||
.args(&["cat-file", "-t", sync.commit.as_str()])
|
||||
.args(["cat-file", "-t", sync.commit.as_str()])
|
||||
.current_dir(&sub_path),
|
||||
);
|
||||
if !commit_exists.is_ok_and(|typ| typ == "commit\n".to_owned()) {
|
||||
if !commit_exists.is_ok_and(|typ| typ == *"commit\n") {
|
||||
info!("Must fetch commit");
|
||||
utils::run_process(process::Command::new("git").current_dir(&sub_path).args(&[
|
||||
utils::run_process(process::Command::new("git").current_dir(&sub_path).args([
|
||||
"fetch",
|
||||
"origin",
|
||||
sync.commit.as_str(),
|
||||
]))?;
|
||||
}
|
||||
|
||||
utils::run_process(process::Command::new("git").current_dir(&sub_path).args(&[
|
||||
utils::run_process(process::Command::new("git").current_dir(&sub_path).args([
|
||||
"reset",
|
||||
"--hard",
|
||||
sync.commit.as_str(),
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ pub fn run_process(cmd: &mut Command) -> Result<String> {
|
|||
);
|
||||
}
|
||||
|
||||
Ok(String::from_utf8(output.stdout).wrap_err("stdout is not UTF-8")?)
|
||||
String::from_utf8(output.stdout).wrap_err("stdout is not UTF-8")
|
||||
}
|
||||
run_process_inner(cmd).wrap_err(format!(
|
||||
"{} {}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue