ron
ron copied to clipboard
Document no_std and requirement of global allocator
#567 was great, but it's a little unclear:
- That
no_stdsupport exists - That a global allocator is required
Also it seems to be that for some types you can do ron::from_str without a global allocator. But if there is an error, then ron will allocate while constructing the error.
Good point @ChocolateLoverRaj! Feel free to submit a follow-up PR that adds an alloc feature.
We could then guard some ser/de impls just how serde does. ron::value would also be guarded on #[cfg(any(std, alloc))]. For error handling, we could, for now, add a dummy-string type that would simply print that the extra info is missing without alloc (I'd be very hesitant to add a lifetime to error, which would also not always be possible).