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
{{ message }}
Repository navigation
Allow MultiUnzip on Result<tuple, E> with behaviour like collect()? #996
But I think the adequate way to solve this would be to implement FromIterator (resp. Extend) for 3-tuples. (I'm kinda surprised to see it's only implemented for 2-tuples, because std usually goes up to 12-tuples. Maybe @jswrenn or @scottmcm know the reasons for this limitation.)
Activity
phimuemue commentedon Oct 23, 2024
Hi there, it seems you'd like to collect into three vectors, throwing away all of them if you encounter an
Errin any tuple component.If so, you probably want
try_collect, and your example boiled down to 2-tuples could look as follows:The remaining problem then lies in the fact that
FromIteratoris only implemented for 2-tuples, but you want 3-tuples. Packing the 3-tuples into nested 2-tuples works around the problem:But I think the adequate way to solve this would be to implement
FromIterator(resp.Extend) for 3-tuples. (I'm kinda surprised to see it's only implemented for 2-tuples, because std usually goes up to 12-tuples. Maybe @jswrenn or @scottmcm know the reasons for this limitation.)phimuemue commentedon Oct 23, 2024
All this raises the question why
multiunzipexists in the first place. I guess it's mainly to mirrormultizipsimilar to howunzipmirrorszip.phimuemue commentedon Oct 24, 2024
Closing this as per rust-lang/rust#85835 (comment) and rust-lang/rust#85835 (comment).