Add 'im' feature for supporting the im crate collections#924
Merged
Conversation
xStrom
reviewed
May 13, 2020
xStrom
approved these changes
May 13, 2020
Member
xStrom
left a comment
There was a problem hiding this comment.
Looks good!
And yeah @Finnerale I have List working in my dev branch. I'll clean it up and send a PR later tonight.
Member
Author
|
keep in mind that in this PR the impl of |
xStrom
reviewed
May 13, 2020
druid/src/data.rs
Outdated
| } | ||
| */ | ||
|
|
||
| self.iter().zip(other.iter()).all(|(a, b)| a.same(b)) |
Member
There was a problem hiding this comment.
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))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.
Member
Author
|
okay, let's get this in and we can play around from here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Datathere, for the time being.