Closed bossmc closed 5 years ago
Sounds reasonable to me. Please add a test!
Re: FromIterator, for things like this I fear it becomes too easy to overlap with other useful impls. I also feel like Vec -> HashMap
doesn't make sense. (if there was a HashMap -> HashMap
, I'd expect it to only operate on values, since operating on keys could create duplicates)
Added a test, also moved the marker index to indices
for consistency.
I've not done anything clever (e.g. IntoIterator/FromIterator) or added support for other container types, though most would be pretty trivial.
Can/should this be part of https://github.com/lloydmeta/frunk/milestone/1?
@ExpHP @Centril if you'd like to review this before merging, just shout :), else I'm thinking we merge this sometime this week and push out a release this weekend :)
Released as 0.2.4, thanks again 😄
This is more a proof of concept than a fully fledged PR, but I wanted to get feedback early before wandering down a garden path of pain.
This PR specifically allows conversions of the form:
Limitations:
Vec
(though other stdlib types would be easy to add)Vec -> Vec
, not (e.g.)Vec -> List
or similar (maybe judicious use ofFromIterator
?)Does this look useful/sensible? Have I missed anything in the implementation?