🧹 shorten the scope of unsafe block
This commit is contained in:
parent
f72abe78c4
commit
28d2394824
|
@ -305,15 +305,13 @@ fn create_options_section() -> gtk::Box {
|
||||||
}
|
}
|
||||||
|
|
||||||
for btn in &[&psd_btn, &systemd_oomd_btn, &apparmor_btn, &bluetooth_btn, &ananicy_cpp_btn] {
|
for btn in &[&psd_btn, &systemd_oomd_btn, &apparmor_btn, &bluetooth_btn, &ananicy_cpp_btn] {
|
||||||
unsafe {
|
let data: &str = unsafe { *btn.data("actionData").unwrap().as_ptr() };
|
||||||
let data: &str = *btn.data("actionData").unwrap().as_ptr();
|
|
||||||
if G_LOCAL_UNITS.lock().unwrap().enabled_units.contains(&String::from(data))
|
if G_LOCAL_UNITS.lock().unwrap().enabled_units.contains(&String::from(data))
|
||||||
|| G_GLOBAL_UNITS.lock().unwrap().enabled_units.contains(&String::from(data))
|
|| G_GLOBAL_UNITS.lock().unwrap().enabled_units.contains(&String::from(data))
|
||||||
{
|
{
|
||||||
btn.set_active(true);
|
btn.set_active(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let is_local_service_enabled = |service_unit_name: &str| -> bool {
|
let is_local_service_enabled = |service_unit_name: &str| -> bool {
|
||||||
let local_units = &G_LOCAL_UNITS.lock().unwrap().enabled_units;
|
let local_units = &G_LOCAL_UNITS.lock().unwrap().enabled_units;
|
||||||
|
|
Loading…
Reference in New Issue