tomaka / hlua

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

Pushing a `Result` probably shouldn't raise a Lua error #125

Closed jonas-schievink closed 7 years ago

jonas-schievink commented 7 years ago

Currently, the impl Push for Result<T, E> will push the T if the result is Ok, or raise a Lua error if it is an Err.

I would have expected it to return a nil, <message> tuple instead, since that is the preferred way of passing errors back to Lua code and thus makes it easy to build idiomatic APIs.

tomaka commented 7 years ago

I see. Only Rust panics would trigger lua errors then.