mlua-rs/mlua

Deserialize from a table with function

dryBranch opened this issue · 2 comments

I used lua script as config file.

When I deserialize from a table with global _ENV, it crashed becase of some built-in functions like print.

Why it crashes instead of skipping unused fields?

Why it crashes instead of skipping unused fields?

This is the default behaviour to not hide any potential issues or unwanted behaviour with your data.

You can skip non-supported types setting deny_unsupported_types: false

See https://docs.rs/mlua/latest/mlua/trait.LuaSerdeExt.html#tymethod.from_value_with

Okay, I got it. Thank you