[code] try to make clippy happy

This commit is contained in:
Philip Mueller 2023-06-22 22:59:04 +02:00
parent ba18f68f8f
commit fb3808335e
3 changed files with 16 additions and 16 deletions

View File

@ -166,7 +166,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
sgdisk sgdisk
.execute() .execute()
.args(&[ .args([
"-Z", "-Z",
"-o", "-o",
&format!("--new=1::+{}M", boot_size), &format!("--new=1::+{}M", boot_size),
@ -175,7 +175,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
"--typecode=1:EF00", "--typecode=1:EF00",
"--typecode=2:EF02", "--typecode=2:EF02",
]) ])
.arg(&disk_path) .arg(disk_path)
.run() .run()
.context("Partitioning error")?; .context("Partitioning error")?;
@ -270,7 +270,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["passwd", "-d", "root"]) .args(["passwd", "-d", "root"])
.run() .run()
.context("Failed to delete the root password")?; .context("Failed to delete the root password")?;
@ -298,7 +298,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["useradd", "-m", "aur"]) .args(["useradd", "-m", "aur"])
.run() .run()
.context("Failed to create temporary user to install AUR packages")?; .context("Failed to create temporary user to install AUR packages")?;
@ -309,7 +309,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["sudo", "-u", "aur"]) .args(["sudo", "-u", "aur"])
.arg("git") .arg("git")
.arg("clone") .arg("clone")
.arg(format!( .arg(format!(
@ -323,7 +323,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&[ .args([
"bash", "bash",
"-c", "-c",
&format!( &format!(
@ -337,8 +337,8 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["sudo", "-u", "aur"]) .args(["sudo", "-u", "aur"])
.args(&command.aur_helper.install_command) .args(command.aur_helper.install_command)
.args(aur_pacakges) .args(aur_pacakges)
.run() .run()
.context("Failed to install AUR packages")?; .context("Failed to install AUR packages")?;
@ -347,7 +347,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["userdel", "-r", "aur"]) .args(["userdel", "-r", "aur"])
.run() .run()
.context("Failed to delete temporary aur user")?; .context("Failed to delete temporary aur user")?;
@ -413,7 +413,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["systemctl", "enable", "NetworkManager"]) .args(["systemctl", "enable", "NetworkManager"])
.run() .run()
.context("Failed to enable NetworkManager")?; .context("Failed to enable NetworkManager")?;
@ -433,7 +433,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["mkinitcpio", "-P"]) .args(["mkinitcpio", "-P"])
.run() .run()
.context("Failed to run mkinitcpio - do you have the base and linux packages installed?")?; .context("Failed to run mkinitcpio - do you have the base and linux packages installed?")?;
@ -444,7 +444,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
.expect("No tool for blkid") .expect("No tool for blkid")
.execute() .execute()
.arg(root_partition_base.path()) .arg(root_partition_base.path())
.args(&["-o", "value", "-s", "UUID"]) .args(["-o", "value", "-s", "UUID"])
.run_text_output() .run_text_output()
.context("Failed to run blkid")?; .context("Failed to run blkid")?;
let trimmed = uuid.trim(); let trimmed = uuid.trim();
@ -467,7 +467,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
arch_chroot arch_chroot
.execute() .execute()
.arg(mount_point.path()) .arg(mount_point.path())
.args(&["bash", "-c"]) .args(["bash", "-c"])
.arg(format!("grub-install --target=i386-pc --boot-directory /boot {} && grub-install --target=x86_64-efi --efi-directory /boot --boot-directory /boot --removable && grub-mkconfig -o /boot/grub/grub.cfg", disk_path.display())) .arg(format!("grub-install --target=i386-pc --boot-directory /boot {} && grub-install --target=x86_64-efi --efi-directory /boot --boot-directory /boot --removable && grub-mkconfig -o /boot/grub/grub.cfg", disk_path.display()))
.run().context("Failed to install grub")?; .run().context("Failed to install grub")?;

View File

@ -14,7 +14,7 @@ impl LoopDevice {
let losetup = Tool::find("losetup")?; let losetup = Tool::find("losetup")?;
let output = losetup let output = losetup
.execute() .execute()
.args(&["--find", "-P", "--show"]) .args(["--find", "-P", "--show"])
.arg(file) .arg(file)
.output() .output()
.context("Error creating the image")?; .context("Error creating the image")?;

View File

@ -12,7 +12,7 @@ pub fn qemu(command: args::QemuCommand) -> anyhow::Result<()> {
let qemu = Tool::find("qemu-system-x86_64")?; let qemu = Tool::find("qemu-system-x86_64")?;
let mut run = qemu.execute(); let mut run = qemu.execute();
run.args(&[ run.args([
"-m", "-m",
"4G", "4G",
"-netdev", "-netdev",
@ -33,7 +33,7 @@ pub fn qemu(command: args::QemuCommand) -> anyhow::Result<()> {
if PathBuf::from("/dev/kvm").exists() { if PathBuf::from("/dev/kvm").exists() {
debug!("KVM is enabled"); debug!("KVM is enabled");
run.args(&["-enable-kvm", "-cpu", "host"]); run.args(["-enable-kvm", "-cpu", "host"]);
} }
let err = run.exec(); let err = run.exec();