Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support heapless primitives #96

Merged
merged 7 commits into from
Oct 19, 2022
Merged

Support heapless primitives #96

merged 7 commits into from
Oct 19, 2022

Conversation

nkrackow
Copy link
Contributor

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? :)

@nkrackow nkrackow requested a review from ryan-summers October 13, 2022 08:43
@nkrackow nkrackow changed the title add string without macro support heapless-string Oct 13, 2022
src/lib.rs Outdated Show resolved Hide resolved
@ryan-summers ryan-summers marked this pull request as ready for review October 19, 2022 09:17
Copy link
Member

@jordens jordens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jordens
Copy link
Member

jordens commented Oct 19, 2022

What about heapless::Vec?

@nkrackow
Copy link
Contributor Author

Recursive macros, sure.. ;)
Thanks!

@jordens
Copy link
Member

jordens commented Oct 19, 2022

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
Copy link
Member

jordens commented Oct 19, 2022

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

@ryan-summers
Copy link
Member

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.

@ryan-summers ryan-summers changed the title support heapless-string Support heapless primitives Oct 19, 2022
src/array.rs Outdated Show resolved Hide resolved
@ryan-summers ryan-summers merged commit 3a07a7f into develop Oct 19, 2022
@ryan-summers ryan-summers deleted the nk/heapless-strings branch October 19, 2022 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants