Stephen Chung
e4d492c727
Fix no_object build.
2022-05-23 22:58:15 +08:00
Geoffroy Couprie
f2b5566c0b
use smartstring's deserializer to support non borrowed strings
...
The map visitor for Dynamic was expecting a &str for the key, but the
serde_json deserializer internally uses a Cow string, which can be
Borrowed or Owned. In the case of Owned, the serde_json key deserializer
is calling visit_string on the Visitor, which for &str will result in
the error:
Error("invalid type: string \"a\", expected a borrowed string", line: 0,
column: 0)
smartstring actually has its own Visitor implementation that handles
both cases, so we can use it instead of an explicit conversion.
2022-05-23 16:40:49 +02:00
Stephen Chung
00b189d0c6
Replace Cow<str> in Scope with SmartString.
2022-01-15 11:26:43 +08:00
Stephen Chung
5dae2b07f7
Add to_dynamic test for Option.
2022-01-13 19:02:37 +08:00
Stephen Chung
f92cbe1f6d
Merge branch 'v1.3-fixes'
2021-12-16 16:10:39 +08:00
Stephen Chung
224aa0ea68
Allow custom syntax inside binary operator expressions.
2021-12-16 16:06:44 +08:00
Stephen Chung
ef14079c61
Add ranges.
2021-12-15 12:06:17 +08:00
Stephen Chung
41dd989866
Support deserialization into byte arrays for BLOB's via serde_bytes.
2021-12-02 14:10:53 +08:00
Stephen Chung
5363b0724f
Support Option in from_dynamic.
2021-12-02 12:50:11 +08:00
Stephen Chung
94674679d9
Rename as_string and as_immutable_string.
2021-08-17 15:50:55 +08:00
Stephen Chung
79d9977cd5
Change take_string and take_immutable_string to as_XXX.
2021-06-10 10:45:44 +08:00
Stephen Chung
7ec49a9510
Fix f32_feature with serde.
2021-04-06 23:18:28 +08:00
Stephen Chung
f92e6f3983
Fix metadata build.
2021-03-05 23:56:00 +08:00
Stephen Chung
426f841aa2
Fix serde build.
2021-03-05 23:41:20 +08:00
Stephen Chung
3650b04c38
Add Decimal number type.
2021-02-13 20:57:56 +08:00
Stephen Chung
ec272cf9b9
Add Serialize/Deserialize for Dynamic and ImmutableString.
2021-01-18 10:30:58 +08:00
Stephen Chung
c463e42987
Fix serde test.
2020-10-10 14:15:23 +08:00
Stephen Chung
a2c0554f3c
Make consistent style.
2020-07-06 21:52:07 +08:00
Alvin Wong
4a3a32dc3a
Fix serializing externally-tagged enum
representations
2020-07-06 21:11:41 +08:00
Alvin Wong
4b6afc9c72
Add enum
serialization tests
2020-07-06 18:32:22 +08:00
Alvin Wong
0644c67252
Impl. deserializing enum
representations
2020-07-06 18:32:22 +08:00
Alvin Wong
8f53ce50d4
Ensure rhai::INT can be deserialized into any integer types
2020-07-06 15:30:56 +08:00
Stephen Chung
78c94daf46
Add ser::to_dynamic.
2020-07-03 22:42:56 +08:00
Stephen Chung
fa84e5c502
Add serde deserialization.
2020-07-03 17:19:55 +08:00