Skip to content
Snippets Groups Projects
Commit 0f7aa571 authored by Maksim Kaitmazian's avatar Maksim Kaitmazian
Browse files

fix: deserialize LuaValue as rmpv::Value

Previously, LuaValue was used for deserializing msgpack data.
It is marked with #[serde(untagged)] attribute, meaning that
the enum is deserializaed by probing each variant in order unless one
succeeds. It turned out, that this can cause unexpected type convertions
due to the order of variants.

For example, msgpack integer value was deserialized into LuaValue::Double,
because this variant comes before LuaValue::Integer and integer values
can be represented as floats.

This commit resolves this issue by configuring LuaValue to be deserialized
as rmpv::Value using #[serde(try_from)] attribute.
parent 5fbab9f7
No related branches found
No related tags found
1 merge request!1475fix: deserialize LuaValue as rmpv::Value
Pipeline #57267 failed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment