Closed Pzixel closed 11 months ago
Yes, I carefully read that you don't support dynamic allocated types, but serde_json
crate claims that they don't support no_std at all. So I'm in the situation where struct Foo(String)
cannot be serialized, not with this crate or serde_json
or any other.
@Pzixel: the solution would be for serde_json
to use the alloc
crate.
But they clearly say "It won't work, and even if it would, I won't support and/or accept any issues caused by this". It's kinda unstable situation.
Can you please provide a reference to that claim? A crate can be (not no_std
) + alloc
. For many operations, the alloc
equivalents could be used.
https://github.com/serde-rs/json/issues/463#issuecomment-405388092
I don't intend to bring no-std support into serde_json as discussed previously in #362.
I reconsidered and would be willing to consider a serde_json PR to use alloc
. https://github.com/serde-rs/json/issues/362#issuecomment-431186156
I too would appreciate if the library used alloc crate types if there was an alloc feature enabled. Now I'm forced to use heapless String type instead of the alloc crate String type if I call to_string for example.
FWIW serde_json should support using only alloc
via (now merged) https://github.com/serde-rs/json/pull/606
AFAICT this can be closed as both not pertinent to serde-json-core
and resolved in serde-json
.
Thank you everybody!
Currently I have following errors:
Could it be done in no-std scenario?