Compare commits

...

2 Commits

Author SHA1 Message Date
Zynh0722 b3946f9131 single scope again 2024-05-15 05:18:34 -07:00
Zynh0722 c290afca3a single scop 2024-05-15 05:17:54 -07:00
1 changed files with 12 additions and 12 deletions

View File

@ -29,21 +29,21 @@ fn main() -> Result<(), Box<dyn Error>> {
let args = Args::parse(); let args = Args::parse();
#[cfg(not(windows))] #[cfg(not(windows))]
let boot_folder = args let boot_folder = unsafe {
.boot_directory args.boot_directory
.or_else(|| PathBuf::from_str(BOOT_PATH).ok()); .or_else(|| PathBuf::from_str(BOOT_PATH).ok())
.unwrap_unchecked()
#[cfg(not(windows))] };
let boot_folder = unsafe { boot_folder.unwrap_unchecked() };
#[cfg(windows)] #[cfg(windows)]
if args.boot_directory.is_none() { let boot_folder = {
eprintln!("You must supply a boot-directory on windows; see --help"); if args.boot_directory.is_none() {
exit(1); eprintln!("You must supply a boot-directory on windows; see --help");
} exit(1);
}
#[cfg(windows)] unsafe { args.boot_directory.unwrap_unchecked() }
let boot_folder = unsafe { args.boot_directory.unwrap_unchecked() }; };
let grub_env = boot_folder.join("grub/grubenv"); let grub_env = boot_folder.join("grub/grubenv");