Skip to content
Snippets Groups Projects
Commit ea7be9ff authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

box-tuple-cdata: review fixes

parent 3f7d20f2
No related branches found
No related tags found
No related merge requests found
......@@ -574,6 +574,7 @@ box_lua_tuple_init(struct lua_State *L)
/* export C functions to Lua */
luaL_newmetatable(L, tuplelib_name);
luaL_register(L, NULL, lbox_tuple_meta);
/* save Lua/C functions to the global variable (cleaned by tuple.lua) */
lua_setglobal(L, "cfuncs");
luaL_register_type(L, tuple_iteratorlib_name,
lbox_tuple_iterator_meta);
......
......@@ -38,6 +38,8 @@ ffi.metatype('struct tuple', {
__gc = tuple_gc;
__len = cfuncs.__len;
__tostring = function(tuple)
-- Unpack tuple, call yaml.encode, remove yaml header and footer
-- 5 = '---\n\n' (header), -6 = '\n...\n' (footer)
return yaml.encode(methods.totable(tuple)):sub(5, -6)
end;
__index = function(tuple, key)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment