You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically every implementation of ToLua is not actually going to consume the value, yet ToLua::to_lua (or 0.9 IntoLua::into_lua) takes self by value.
The only time I can think when you might need to move out of self when converting to a mlua::Value is when self contains a lua object in the first place, in which case you can just cheaply clone it.
I am finding I sometimes have to clone more expensive things to convert them to Lua values when that shouldn't be necessary.
Should the method take &self?
Maybe only require Self: ?Sized?
The only downside I can see is that it would be a breaking change, and a minor one to patch at that.
If this is agreeable, I'd be happy to implement it.
The text was updated successfully, but these errors were encountered:
The only time I can think when you might need to move out of self when converting to a mlua::Value is when self contains a lua object in the first place, in which case you can just cheaply clone it.
Basically every implementation of
ToLua
is not actually going to consume the value, yetToLua::to_lua
(or 0.9IntoLua::into_lua
) takesself
by value.The only time I can think when you might need to move out of self when converting to a
mlua::Value
is whenself
contains a lua object in the first place, in which case you can just cheaply clone it.I am finding I sometimes have to clone more expensive things to convert them to Lua values when that shouldn't be necessary.
Should the method take
&self
?Maybe only require
Self: ?Sized
?The only downside I can see is that it would be a breaking change, and a minor one to patch at that.
If this is agreeable, I'd be happy to implement it.
The text was updated successfully, but these errors were encountered: