diff --git a/lvgl-codegen/src/lib.rs b/lvgl-codegen/src/lib.rs index 5378283..d10fa4a 100644 --- a/lvgl-codegen/src/lib.rs +++ b/lvgl-codegen/src/lib.rs @@ -228,7 +228,7 @@ impl Rusty for LvFunc { // TODO Unsafe function for getters should be lvgl_sys::lv_bar_get_value(self.core.raw().as_ptr()) ? // Currently they are lvgl_sys :: lv_bar_get_value (self . core . raw () . as_mut ()) } - let args_call = self + let ffi_args = self .args .iter() .enumerate() @@ -253,14 +253,14 @@ impl Rusty for LvFunc { // NOTE: When the function returns something we can 'avoid' placing an Ok() // at the end. - let return_ok_at_the_end = if return_type.is_empty() { + let explicit_ok = if return_type.is_empty() { quote!(Ok(())) } else { quote!() }; // And we can also return from the unsafe block by removing the ; at the end - let implicit_return = if has_return_value { + let optional_semicolon = if has_return_value { quote!() } else { quote!(;) @@ -270,10 +270,10 @@ impl Rusty for LvFunc { pub fn #func_name(#args_decl) -> #return_type { #args_processing unsafe { - lvgl_sys::#original_func_name(#args_call)#implicit_return + lvgl_sys::#original_func_name(#ffi_args)#optional_semicolon } - #return_ok_at_the_end + #explicit_ok } }) }