File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,6 @@ use winreg::enums::*;
44use std:: { env, fs} ;
55use winreg;
66
7- macro_rules! try_opt {
8- ( $opt: expr) => {
9- if let Some ( o) = $opt {
10- o
11- } else {
12- return None ;
13- }
14- }
15- }
16-
177pub const SUPPORTED : bool = true ;
188
199#[ derive( Clone , Copy , Eq , PartialEq ) ]
@@ -69,12 +59,12 @@ fn find_latest_windows_sdk_rc_exe(arch: Arch) -> Option<PathBuf> {
6959
7060// Windows 10 with subdir support
7161fn find_windows_10_kits_rc_exe ( key : & str , arch : Arch ) -> Option < PathBuf > {
72- let root_dir = try_opt ! ( winreg:: RegKey :: predef( HKEY_LOCAL_MACHINE )
62+ let root_dir = ( winreg:: RegKey :: predef ( HKEY_LOCAL_MACHINE )
7363 . open_subkey_with_flags ( r"SOFTWARE\Microsoft\Windows Kits\Installed Roots" , KEY_QUERY_VALUE )
7464 . and_then ( |reg_key| reg_key. get_value :: < String , _ > ( key) )
75- . ok( ) ) + "/bin" ;
65+ . ok ( ) ) ? + "/bin" ;
7666
77- for entry in try_opt ! ( fs:: read_dir( & root_dir) . ok( ) ) . filter ( |d| d. is_ok ( ) ) . map ( Result :: unwrap) {
67+ for entry in fs:: read_dir ( & root_dir) . ok ( ) ? . filter ( |d| d. is_ok ( ) ) . map ( Result :: unwrap) {
7868 let fname = entry. file_name ( ) . into_string ( ) ;
7969 let ftype = entry. file_type ( ) ;
8070 if fname. is_err ( ) || ftype. is_err ( ) || ftype. unwrap ( ) . is_file ( ) {
You can’t perform that action at this time.
0 commit comments