Open leighmcculloch opened 9 months ago
The docs are outdated, thank you for pointing this out. They are from the original serde-json-core.
For JSON neither serialization nor deseralization can be done zero-copy without heavily restricting the supported contents because of escaping. E.g.
\
(1 byte) gives you "\\"
(2 bytes)"23\u00B0C"
(9 bytes) returns 23°C
(4 bytes)
The docs appear to say: https://github.com/CosmWasm/serde-json-wasm/blob/2ab22a6f3a741b4db507c464185d86beefc5bab6/src/lib.rs#L11 https://github.com/CosmWasm/serde-json-wasm/blob/2ab22a6f3a741b4db507c464185d86beefc5bab6/src/lib.rs#L15-L18
However, looking at the API,
DeserializedOwned
is required: https://github.com/CosmWasm/serde-json-wasm/blob/2ab22a6f3a741b4db507c464185d86beefc5bab6/src/de/mod.rs#L654-L656What's the right way to use the lib to do deserialisation with &str fields being a zero copy?
Thanks!