We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Would like to request an _exact version of the chunks method akin to how slices work. I believe this would be useful functionality.
_exact
chunks
The text was updated successfully, but these errors were encountered:
+1 to that!
Sorry, something went wrong.
Like array_chunks? Or something else?
array_chunks
I'm unsure how best to represent the tail for this. Slices have it easy, since https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_chunks can just split it up-front into the chunks part and the less-than-the-chunk-size tail (rust-lang/rust#76354).
@mzr @JosephKyser Would it be fine for your uses if this only worked on ExactSizeIterators? The simplest version of this would be something like
ExactSizeIterator
if self.len() < N { None } else { Some(array::from_fn(|_| self.inner.next().unwrap())) }
but if it needs to build up state as it go and return that for the tail later it gets much messier.
No branches or pull requests
Would like to request an
_exact
version of thechunks
method akin to how slices work. I believe this would be useful functionality.The text was updated successfully, but these errors were encountered: