mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 23:19:29 +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,
|
disk: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create(command: CreateCommand) -> Result<(), Error> {
|
fn create(command: &CreateCommand) -> Result<(), Error> {
|
||||||
let sgdisk = Tool::find("sgdisk")?;
|
let sgdisk = Tool::find("sgdisk")?;
|
||||||
let pacstrap = Tool::find("pacstrap")?;
|
let pacstrap = Tool::find("pacstrap")?;
|
||||||
let arch_chroot = Tool::find("arch-chroot")?;
|
let arch_chroot = Tool::find("arch-chroot")?;
|
||||||
@ -153,7 +153,7 @@ fn create(command: CreateCommand) -> Result<(), Error> {
|
|||||||
"networkmanager",
|
"networkmanager",
|
||||||
"btrfs-progs",
|
"btrfs-progs",
|
||||||
"broadcom-wl",
|
"broadcom-wl",
|
||||||
]).args(command.extra_packages)
|
]).args(&command.extra_packages)
|
||||||
.run(ErrorKind::Pacstrap)?;
|
.run(ErrorKind::Pacstrap)?;
|
||||||
|
|
||||||
let fstab = genfstab
|
let fstab = genfstab
|
||||||
@ -206,7 +206,7 @@ fn create(command: CreateCommand) -> Result<(), Error> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn chroot(command: ChrootCommand) -> Result<(), Error> {
|
fn chroot(command: &ChrootCommand) -> Result<(), Error> {
|
||||||
let arch_chroot = Tool::find("arch-chroot")?;
|
let arch_chroot = Tool::find("arch-chroot")?;
|
||||||
|
|
||||||
if !(command.disk.starts_with("/dev/disk/by-id")
|
if !(command.disk.starts_with("/dev/disk/by-id")
|
||||||
@ -273,8 +273,8 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let result = match app {
|
let result = match app {
|
||||||
App::Create(command) => create(command),
|
App::Create(command) => create(&command),
|
||||||
App::Chroot(command) => chroot(command),
|
App::Chroot(command) => chroot(&command),
|
||||||
};
|
};
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user