-
Notifications
You must be signed in to change notification settings - Fork 311
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
CowArray feature #632
CowArray feature #632
Conversation
Merge main rep master to fork master
tests/array.rs
Outdated
S2: Data<Elem=A>, | ||
D: Dimension | ||
{ | ||
arr1.iter().zip(arr2.iter()).all(|(x1, x2)| x1 == x2) |
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.
Any reason why you can't use the good old assert_eq!
? Your first usage looks like
assert!(is_content_identical(&arr_cow, &expected_arr));
and I don't understand why assert_eq!
can't do the job.
tests/array.rs
Outdated
} | ||
|
||
#[test] | ||
fn test_is_owned() { |
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.
It's only a suggestion, but I would merge test_is_view
and test_is_owned
because one is simply the reverse of the other,
@nilgoyette thanks for your notes, I've updated the PR. |
@jturner314 any feedback on this? Once it's merged, I will be able to update #616 . |
I'm sorry for the delay. Life has been busy recently. I've created andrei-papou#7 with the following:
Once that's merged, I think we're good-to-go on this PR. |
Improve CowArray stuff
Yay! I've been wanting this feature for quite a while. Thanks for working on it! |
Excellent, this brings me one step closer to being able to pass in slices containing arrays, like I believe that right now, due to monomorphisation, I wouldn't actually be able to pass in a mixture of I have to play around with it, but I don't think this feature will completely fix this either, because the trait bound Might a |
@SuperFluffy I'm not sure |
Right, all the elements in a slice need to have the same type. @SuperFluffy It seems like you want to be able to do something like this, but for let slice = &[1, 2, 3][..];
let vec = vec![4, 5, 6];
let collection = &[slice, &vec]; Note that this doesn't work with let collection = &[&slice, &vec]; which is the statement analogous to An implementation of For arrays, why not just call let collection = &[arr1.view(), arr2.view()]; If you need mutable views, then use |
No description provided.