mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-25 22:49:28 +02:00
Avoid needless consumption
This commit is contained in:
parent
406ed1325f
commit
3415750123
10
src/main.rs
10
src/main.rs
@ -70,7 +70,7 @@ struct ChrootCommand {
|
||||
disk: PathBuf,
|
||||
}
|
||||
|
||||
fn create(command: CreateCommand) -> Result<(), Error> {
|
||||
fn create(command: &CreateCommand) -> Result<(), Error> {
|
||||
let sgdisk = Tool::find("sgdisk")?;
|
||||
let pacstrap = Tool::find("pacstrap")?;
|
||||
let arch_chroot = Tool::find("arch-chroot")?;
|
||||
@ -153,7 +153,7 @@ fn create(command: CreateCommand) -> Result<(), Error> {
|
||||
"networkmanager",
|
||||
"btrfs-progs",
|
||||
"broadcom-wl",
|
||||
]).args(command.extra_packages)
|
||||
]).args(&command.extra_packages)
|
||||
.run(ErrorKind::Pacstrap)?;
|
||||
|
||||
let fstab = genfstab
|
||||
@ -206,7 +206,7 @@ fn create(command: CreateCommand) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn chroot(command: ChrootCommand) -> Result<(), Error> {
|
||||
fn chroot(command: &ChrootCommand) -> Result<(), Error> {
|
||||
let arch_chroot = Tool::find("arch-chroot")?;
|
||||
|
||||
if !(command.disk.starts_with("/dev/disk/by-id")
|
||||
@ -273,8 +273,8 @@ fn main() {
|
||||
}
|
||||
|
||||
let result = match app {
|
||||
App::Create(command) => create(command),
|
||||
App::Chroot(command) => chroot(command),
|
||||
App::Create(command) => create(&command),
|
||||
App::Chroot(command) => chroot(&command),
|
||||
};
|
||||
|
||||
match result {
|
||||
|
Loading…
x
Reference in New Issue
Block a user