From 5ca72622d4f43d126aa63fe10bd6cd94026822e9 Mon Sep 17 00:00:00 2001 From: C47D Date: Mon, 13 Jan 2025 19:15:47 -0600 Subject: [PATCH] codegen: Renaming some variables for clarity --- lvgl-codegen/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 } }) }