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: generic identifier #27

Merged
merged 4 commits into from
Oct 30, 2023
Merged

feat: generic identifier #27

merged 4 commits into from
Oct 30, 2023

Conversation

EdJoPaTo
Copy link
Owner

closes #24

@EdJoPaTo EdJoPaTo changed the title feat: allow for generic identifier feat: generic identifier Oct 26, 2023
@EdJoPaTo
Copy link
Owner Author

This approach where the identifier needs to be unique among its item siblings basically screams for a Map<Identifier, TreeItem>.

Both HashMap and BTreeMap are not ordered (see https://stackoverflow.com/questions/30243100/how-do-i-sort-a-map-by-order-of-insertion). To keep some sort of order with the items this would require either PartialOrd on Identifier or some thing like this: items: HashMap<Identifier, TreeItem>, order: Vec<Identifier>.

Both approaches don't seem easy to use to me.

@EdJoPaTo
Copy link
Owner Author

I think going this route for now is the best approach. There might be better options which other people can suggest after playing around with this new release. (Feel free to open a new issue discussing your idea!)

@EdJoPaTo EdJoPaTo merged commit b914819 into main Oct 30, 2023
32 checks passed
@EdJoPaTo EdJoPaTo deleted the generic-identifier branch October 30, 2023 12:19
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.

Improve TreeIdentifier
1 participant