-
Notifications
You must be signed in to change notification settings - Fork 569
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
Add 'im' feature for supporting the im crate collections #924
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm eager to give this a shot in my app 😄
I will need List<Vector<T>>
support for it tho, but if I understood that correctly, @xStrom seems to be onto it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
And yeah @Finnerale I have List
working in my dev branch. I'll clean it up and send a PR later tonight.
keep in mind that in this PR the impl of |
druid/src/data.rs
Outdated
} | ||
*/ | ||
|
||
self.iter().zip(other.iter()).all(|(a, b)| a.same(b)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't correct after all, because it will stop comparing after the shorter iterator ends. So this will return true
for [1, 2, 3]
vs [1, 2, 3, 4]
.
The correct way would be to use eq_by
but that's nightly only.
So something like the following is needed:
self.len() == other.len() && self.iter().zip(other.iter()).all(|(a, b)| a.same(b))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, good catch
This is an experiment; the idea is to encourage the use of these types over std::collections. There's currently an issue or two with im::Vector, so this includes a poor implementation of `Data` there, for the time being.
okay, let's get this in and we can play around from here. |
This is an experiment; the idea is to encourage the use of these
types over std::collections.
There's currently an issue or two with im::Vector, so this includes
a poor implementation of
Data
there, for the time being.