From f9b775eff11593920fcc7e4b9979b24b8b934ddf Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 20 Apr 2022 13:30:45 +0200 Subject: [PATCH] Fix lint errors Signed-off-by: trivernis --- src/functions/base.rs | 2 +- src/functions/partition.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/functions/base.rs b/src/functions/base.rs index a5667d2..4e68ca4 100755 --- a/src/functions/base.rs +++ b/src/functions/base.rs @@ -73,7 +73,7 @@ pub fn install_bootloader_legacy(device: PathBuf) { exec_eval( exec_chroot( "grub-install", - vec![String::from("--target=i386-pc"), String::from(device)], + vec![String::from("--target=i386-pc"), device], ), "install grub as legacy", ); diff --git a/src/functions/partition.rs b/src/functions/partition.rs index f7a4045..478bf4d 100755 --- a/src/functions/partition.rs +++ b/src/functions/partition.rs @@ -1,7 +1,7 @@ use crate::args::PartitionMode; use crate::internal::exec::*; use crate::internal::*; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; pub fn partition(device: PathBuf, mode: PartitionMode, efi: bool) { if !device.exists() { @@ -27,7 +27,7 @@ pub fn partition(device: PathBuf, mode: PartitionMode, efi: bool) { } } -fn partition_no_efi(device: &PathBuf) { +fn partition_no_efi(device: &Path) { let device = device.to_string_lossy().to_string(); exec_eval( exec( @@ -61,7 +61,7 @@ fn partition_no_efi(device: &PathBuf) { "parted", vec![ String::from("-s"), - String::from(device), + device, String::from("mkpart"), String::from("primary"), String::from("btrfs"), @@ -73,7 +73,7 @@ fn partition_no_efi(device: &PathBuf) { ); } -fn partition_with_efi(device: &PathBuf) { +fn partition_with_efi(device: &Path) { let device = device.to_string_lossy().to_string(); exec_eval( exec( @@ -106,7 +106,7 @@ fn partition_with_efi(device: &PathBuf) { "parted", vec![ String::from("-s"), - String::from(device), + device, String::from("mkpart"), String::from("btrfs"), String::from("300"), @@ -117,7 +117,7 @@ fn partition_with_efi(device: &PathBuf) { ); } -fn part_nvme(device: &PathBuf, efi: bool) { +fn part_nvme(device: &Path, efi: bool) { let device = device.to_string_lossy().to_string(); if efi { exec_eval( @@ -220,7 +220,7 @@ fn part_nvme(device: &PathBuf, efi: bool) { } } -fn part_disk(device: &PathBuf, efi: bool) { +fn part_disk(device: &Path, efi: bool) { let device = device.to_string_lossy().to_string(); if efi { exec_eval(