Added support for generic structs in LuaDeviceConfig
This commit is contained in:
parent
14aabe202d
commit
eefb476d7f
|
@ -260,8 +260,9 @@ pub fn impl_lua_device_config_macro(ast: &DeriveInput) -> TokenStream {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
let (impl_generics, type_generics, where_clause) = ast.generics.split_for_impl();
|
||||||
let impl_from_lua = quote! {
|
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<Self> {
|
fn from_lua(value: mlua::Value, lua: &mlua::Lua) -> mlua::Result<Self> {
|
||||||
if !value.is_table() {
|
if !value.is_table() {
|
||||||
panic!("Expected table");
|
panic!("Expected table");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user