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

Consider allowing non-string key types in Map #61

Closed
fasterthanlime opened this issue Sep 14, 2024 · 3 comments
Closed

Consider allowing non-string key types in Map #61

fasterthanlime opened this issue Sep 14, 2024 · 3 comments

Comments

@fasterthanlime
Copy link
Contributor

To accomodate for YAML, for starters. JSON should still work.

@fasterthanlime
Copy link
Contributor Author

So the awkward thing is that f64 etc. cannot be hashed, so... it doesn't super work.

@fasterthanlime
Copy link
Contributor Author

fasterthanlime commented Sep 22, 2024

Maybe provide a Record type that's like Vec<(Value, Value)> ?

@fasterthanlime
Copy link
Contributor Author

...or maybe Value::Map should be backed by Vec<(Value, Value)> and the docs for get() etc. should let you know that for bigger maps it's gonna be slow and you can do .to_keystring_map or something if you need fast lookups.

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

No branches or pull requests

1 participant