Remove unnecessary imports

This commit is contained in:
Jakub Clark 2020-05-31 02:38:57 +02:00
parent 59a399b290
commit b82c06dc83
2 changed files with 6 additions and 5 deletions

View file

@ -115,7 +115,7 @@ macro_rules! define_object {
} }
impl $crate::support::NativeObject for $item { impl $crate::support::NativeObject for $item {
fn raw(&self) -> ptr::NonNull<lvgl_sys::lv_obj_t> { fn raw(&self) -> core::ptr::NonNull<lvgl_sys::lv_obj_t> {
self.core.raw() self.core.raw()
} }
} }
@ -123,8 +123,11 @@ macro_rules! define_object {
impl $crate::support::Object for $item { impl $crate::support::Object for $item {
fn set_style(&mut self, style: $crate::support::Style) { fn set_style(&mut self, style: $crate::support::Style) {
unsafe { unsafe {
let boxed = Box::new(style.raw); let boxed = alloc::boxed::Box::new(style.raw);
lvgl_sys::lv_obj_set_style(self.raw().as_mut(), Box::into_raw(boxed)); lvgl_sys::lv_obj_set_style(
self.raw().as_mut(),
alloc::boxed::Box::into_raw(boxed),
);
}; };
} }
} }

View file

@ -1,6 +1,4 @@
// use crate::define_object;
use crate::support::{NativeObject, ObjectX}; use crate::support::{NativeObject, ObjectX};
use alloc::boxed::Box;
use core::ptr; use core::ptr;
use lvgl_sys; use lvgl_sys;