-
Notifications
You must be signed in to change notification settings - Fork 295
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
Make Intersperse[With]
lazy
#797
Make Intersperse[With]
lazy
#797
Conversation
89d7c61
to
8286788
Compare
@@ -54,18 +54,17 @@ where | |||
{ | |||
element: ElemF, | |||
iter: Fuse<I>, | |||
peek: Option<I::Item>, | |||
peek: Option<Option<I::Item>>, |
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.
With the added nesting, could you just write a comment here about how the value of peek
should be interpreted? (None
, Some(None)
, Some(Some(...))
?
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.
Done. And I will do the same for Product
and CoalesceBy
before publishing their similar laziness fix.
Similar to what is done by `core::iter::Peekable`, a nested option is now used.
aa88619
to
0dd980b
Compare
Related to #792
To make
Intersperse[With]
adaptors lazy, I use a nested option which is whatcore::iter::Peekable
uses internally.EDITs: I certainly hope that it's okay to use a nested option in such case because I did a similar thing to make
Product
lazy (fixingcartesian_product
andiproduct!
un-laziness) and makeCoalesceBy
lazy (fixing 5 methods) that I'll publish once this PR is merged.