You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking at the ZipSlices impl and noticed that you have the signatures impl<'a, 'b, A, B> ZipSlices<&'a [A], &'b [B]> and impl<T, U> ZipSlices<T, U> where T: Slice, U: Slice. The latter seems a lot more general, and I was wondering why the former is still in the library? Are there some non-trivial reasons for this?
The text was updated successfully, but these errors were encountered:
SuperFluffy
changed the title
Redundant impl for ZipSlices?
Why the extra impl for ZipSlices?
Oct 7, 2015
Yes, the reason is that the non-general one will force coercions, so it will actually work with arguments like &Vec<T>, so it's easier to use. Only problem is I've basically inverted the names for the two methods..
I was looking at the
ZipSlices
impl and noticed that you have the signaturesimpl<'a, 'b, A, B> ZipSlices<&'a [A], &'b [B]>
andimpl<T, U> ZipSlices<T, U> where T: Slice, U: Slice
. The latter seems a lot more general, and I was wondering why the former is still in the library? Are there some non-trivial reasons for this?The text was updated successfully, but these errors were encountered: