From eefb476d7f77f7ff4ec574ce9916c03e44e165c4 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sun, 8 Dec 2024 01:53:04 +0100 Subject: [PATCH] Added support for generic structs in LuaDeviceConfig --- automation_macro/src/lua_device_config.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automation_macro/src/lua_device_config.rs b/automation_macro/src/lua_device_config.rs index 9a6542e..6dc12a1 100644 --- a/automation_macro/src/lua_device_config.rs +++ b/automation_macro/src/lua_device_config.rs @@ -260,8 +260,9 @@ pub fn impl_lua_device_config_macro(ast: &DeriveInput) -> TokenStream { }) .collect(); + let (impl_generics, type_generics, where_clause) = ast.generics.split_for_impl(); let impl_from_lua = quote! { - impl mlua::FromLua for #name { + impl #impl_generics mlua::FromLua for #name #type_generics #where_clause { fn from_lua(value: mlua::Value, lua: &mlua::Lua) -> mlua::Result { if !value.is_table() { panic!("Expected table");