Skip to content

Conversation

aobatact
Copy link
Contributor

@aobatact aobatact commented Feb 7, 2022

Fix #601 anyway because this change will reduce one clone.

@jswrenn jswrenn force-pushed the lazy_tuple_windows branch from c7bf86a to 25b1149 Compare October 3, 2023 19:29
Copy link
Member

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rebased and rustfmt'd this PR, but it's still failing a test. Can you fix the bug?

@Philippe-Cholet
Copy link
Member

Philippe-Cholet commented Oct 4, 2023

I deleted my previous comment, it was wrong (I must have been sleeping ^^). We would definitely need to update size_hint but there is no issue about ExactSizeIterator (the resulting iterator being shorter than the inner one, not longer 😪). Probably

use crate::size_hint::{self, SizeHint};

// then
    fn size_hint(&self) -> SizeHint {
        size_hint::sub_scalar(self.iter.size_hint(), T::num_items() - 1)
    }

EDIT: I was partially wrong, but real fix committed.

aobatact and others added 4 commits October 6, 2023 15:51
@Philippe-Cholet
Copy link
Member

@jswrenn This is ready for me, what do you think?

@jswrenn jswrenn added this pull request to the merge queue Oct 6, 2023
Merged via the queue into rust-itertools:master with commit 8db450f Oct 6, 2023
@Philippe-Cholet Philippe-Cholet added this to the next milestone Nov 3, 2023
@jswrenn jswrenn mentioned this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Laziness in tuple_windows

3 participants