fix(mac-utils): fix warnings

This commit is contained in:
Federico Terzi 2021-10-05 23:18:11 +02:00
parent db0ea18a84
commit e3788ea868

View File

@ -86,32 +86,20 @@ fn get_app_name_from_path(path: &str) -> Option<String> {
}; };
let caps = APP_REGEX.captures(&path); let caps = APP_REGEX.captures(&path);
if let Some(caps) = caps { caps.map(|caps| caps.get(1).map_or("", |m| m.as_str()).to_owned())
Some(caps.get(1).map_or("", |m| m.as_str()).to_owned())
} else {
None
}
} }
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub fn check_accessibility() -> bool { pub fn check_accessibility() -> bool {
unsafe { unsafe {
if ffi::mac_utils_check_accessibility() > 0 { ffi::mac_utils_check_accessibility() > 0
true
} else {
false
}
} }
} }
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub fn prompt_accessibility() -> bool { pub fn prompt_accessibility() -> bool {
unsafe { unsafe {
if ffi::mac_utils_prompt_accessibility() > 0 { ffi::mac_utils_prompt_accessibility() > 0
true
} else {
false
}
} }
} }