🧹 shorten the scope of unsafe block
This commit is contained in:
parent
f72abe78c4
commit
28d2394824
12
src/pages.rs
12
src/pages.rs
|
@ -305,13 +305,11 @@ 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue