tomaka / hlua

Rust library to interface with Lua
MIT License
510 stars 48 forks source link

By value captures #63

Closed tiffany352 closed 8 years ago

tiffany352 commented 8 years ago

Allows capturing the context by value instead of using a borrow, which is useful for embedding a long-living table in a struct.

tomaka commented 8 years ago

I don't think you should remove the implementations of AsLua and AsMutLua for references. I'm surprised that the tests are passing.

tiffany352 commented 8 years ago

I got errors because it created conflicting implementations (for &mut Lua, should it pick the &mut impl and then the Lua impl, or should it pick the &mut Lua impl?). I'm not sure how to resolve the issue otherwise, and I'm not really sure what's so bad about it.

TyOverby commented 8 years ago

Would this be something that would be easier to solve when specialization lands?

tomaka commented 8 years ago

Ah, sorry, nevermind. I forgot that there was impl AsLua for &'a T where T: AsLua {}.