quartiq / miniconf

Rust serialize/deserialize/access reflection for trees (no_std, no alloc)
MIT License
23 stars 2 forks source link

Support heapless primitives #96

Closed nkrackow closed 1 year ago

nkrackow commented 1 year ago

It would be nice to have heapless string support for miniconf out of the box. I tested this working but you can probably fumble it into the macro as well? Sorry, I'm not an expert on macros and I didn't want to spend more time on this now. Maybe this is easy for you @ryan-summers? :)

jordens commented 1 year ago

What about heapless::Vec?

nkrackow commented 1 year ago

Recursive macros, sure.. ;) Thanks!

jordens commented 1 year ago

Note that the macro should not be needed at all. It could be a plain generic impl. The only reason the macro is needed is to exclude arrays from the generic impl (no negative trait bounds or negative impl yet). https://github.com/quartiq/miniconf/compare/rj/yay-no-macro?expand=1

jordens commented 1 year ago

Maybe that's an indication that having the custom impl of array is a suboptimal solution.

ryan-summers commented 1 year ago

The only reason the macro is needed is to exclude arrays from the generic impl

Correct. Is there a way we can exclude arrays in a generic manner from the blanket impl? I'm not so sure yet.