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

feat: Add FromMeta support for BTreeMap #287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Techassi
Copy link

This PR adds an FromMeta implementation for BTreeMap<String, V> and BTreeMap<syn::Ident, V> by adjusting the existing macro. The macro can now handle both HashMap and BTreeMap, because much of the underlying code is the same.

I also added new unit tests to test the BTreeMap implementation.

@TedDriggs
Copy link
Owner

The code for this looks fine to me, but I am curious what the use-case is that needs this. Are you doing something that needs the keys to always be sorted?

@Techassi
Copy link
Author

Techassi commented May 3, 2024

Yeah I had a very rare use-case where this behaviour was required. But I can see that this feature seems to be needed very rarely.

@TedDriggs
Copy link
Owner

@Techassi is this something you'd still use if it was merged? If so, can you elaborate on the use-case?

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.

None yet

2 participants