From c290afca3a21d762d675396422a6d18c8bb0206a Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Wed, 15 May 2024 05:17:54 -0700 Subject: [PATCH] single scop --- src/main.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index e739da3..a37092a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,13 +37,14 @@ fn main() -> Result<(), Box> { let boot_folder = unsafe { boot_folder.unwrap_unchecked() }; #[cfg(windows)] - if args.boot_directory.is_none() { - eprintln!("You must supply a boot-directory on windows; see --help"); - exit(1); - } + let boot_folder = { + if args.boot_directory.is_none() { + eprintln!("You must supply a boot-directory on windows; see --help"); + exit(1); + } - #[cfg(windows)] - let boot_folder = unsafe { args.boot_directory.unwrap_unchecked() }; + unsafe { args.boot_directory.unwrap_unchecked() } + }; let grub_env = boot_folder.join("grub/grubenv");