Skip to content
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

Can't iterate over ReadyFramesQueue<T> without consuming it #55

Open
dwlsalmeida opened this issue Nov 20, 2023 · 0 comments
Open

Can't iterate over ReadyFramesQueue<T> without consuming it #55

dwlsalmeida opened this issue Nov 20, 2023 · 0 comments

Comments

@dwlsalmeida
Copy link
Collaborator

dwlsalmeida commented Nov 20, 2023

The actual code does not seem to match the docs:

/// Allows us to manipulate the frames list like an iterator without consuming it and resetting its
/// display order counter.
impl<'a, T> Iterator for &'a mut ReadyFramesQueue<T> {
    type Item = T;

    /// Returns the next frame (if any) waiting to be dequeued.
    fn next(&mut self) -> Option<T> {
        self.queue.pop_front()
    }
}

iter_mut() calls pop_front(), so it is actually not possible to iterate without removing items

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

No branches or pull requests

1 participant