diff --git a/hlua/src/rust_tables.rs b/hlua/src/rust_tables.rs old mode 100644 new mode 100755 index 5a38f26d..ffcf3adb --- a/hlua/src/rust_tables.rs +++ b/hlua/src/rust_tables.rs @@ -101,14 +101,15 @@ impl<'lua, L, T, E> PushOne for Vec { } -impl<'lua, L> LuaRead for Vec - where L: AsMutLua<'lua> +impl<'lua, L, V> LuaRead for Vec + where L: AsMutLua<'lua>, + V: for<'a> LuaRead<&'a mut L> { fn lua_read_at_position(lua: L, index: i32) -> Result { // We need this as iteration order isn't guaranteed to match order of // keys, even if they're numeric // https://www.lua.org/manual/5.2/manual.html#pdf-next - let mut dict: BTreeMap = BTreeMap::new(); + let mut dict: BTreeMap = BTreeMap::new(); let mut me = lua; unsafe { ffi::lua_pushnil(me.as_mut_lua().0) }; @@ -132,7 +133,7 @@ impl<'lua, L> LuaRead for Vec } }; - let value: AnyLuaValue = + let value: V = LuaRead::lua_read_at_position(&mut me, -1).ok().unwrap(); unsafe { ffi::lua_pop(me.as_mut_lua().0, 1) };