ron icon indicating copy to clipboard operation
ron copied to clipboard

Document no_std and requirement of global allocator

Open ChocolateLoverRaj opened this issue 5 months ago • 1 comments

#567 was great, but it's a little unclear:

  • That no_std support 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.

ChocolateLoverRaj avatar Jul 01 '25 06:07 ChocolateLoverRaj

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).

juntyr avatar Jul 01 '25 06:07 juntyr