summaryrefslogtreecommitdiff
path: root/src/value.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2021-01-20 10:44:32 +0000
committerAlex Orlenko <zxteam@protonmail.com>2021-01-20 10:46:23 +0000
commitb6ff501b8c2f0d38eb6ba08507a118c10e688a29 (patch)
tree0dfa2abe9722ed163faa594b9ce87dd748d5aca4 /src/value.rs
parent0e73ae18f4d84bdefa15aa01be0d19555c8e7185 (diff)
downloadmlua-b6ff501b8c2f0d38eb6ba08507a118c10e688a29.zip
Fix numeric types conversion for 32bit lua. Fix #27
Diffstat (limited to 'src/value.rs')
-rw-r--r--src/value.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/value.rs b/src/value.rs
index ffd36c6..174eddd 100644
--- a/src/value.rs
+++ b/src/value.rs
@@ -125,8 +125,8 @@ impl<'lua> Serialize for Value<'lua> {
match self {
Value::Nil => serializer.serialize_unit(),
Value::Boolean(b) => serializer.serialize_bool(*b),
- Value::Integer(i) => serializer.serialize_i64(*i),
- Value::Number(n) => serializer.serialize_f64(*n),
+ Value::Integer(i) => serializer.serialize_i64((*i).into()),
+ Value::Number(n) => serializer.serialize_f64((*n).into()),
Value::String(s) => s.serialize(serializer),
Value::Table(t) => t.serialize(serializer),
Value::UserData(ud) => ud.serialize(serializer),