feat(tlua): now can read strict numeric types using Strict
Reading regular numeric types from lua types will performs implicit coercion:
let i: i64 = lua.eval("return 3.14").unwrap();
assert_eq!(i, 3);
But now can use Strict
to read strictly specified type without implicit coercions:
use tlua::Strict;
let i: Option<Strict<i64>> = lua.eval("return 3.14").ok();
assert_eq!(i, None);
let f: Option<Strict<f32>> = lua.eval("return 3.14").ok();
assert_eq!(f, Some(Strict(3.14)));