-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make it clear that chunks() and chunks_mut() can be called on their own chunks #31773
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
Comments
Is it enough to stress that each chunk is itself a slice (or mutable slice)? |
Hm. What would be the distinction between stressing it and showing it? In theory, it should be obvious that because the chunk is a slice, you can call Either option is an improvement, and I'm probably over-thinking the whole thing now. |
In general, API docs usually are written for an intermediate/advanced user: we don't generally mention "oh and because this has a return type of foo you can call these other things on it." Where does this stop and end? |
Fair point. But what about explicitly stating that the functions return slices, as opposed to "an iterator"? |
It does return an iterator - an iterator over slices. |
Undeniably true, but I don't think it's clear; The docs say "an iterator over |
I'm not sure one would be able to use |
Yes we should clarify the docs to say it returns an iterator whose elements are slices. |
I know that it's implied by the docs, but it wasn't immediately obvious to me that the chunks returned by
chunks()
andchunks_mut()
can (I'm avoiding use of the term "recursive" here) havechunks
orchunks_mut
called on themselves (playground).Is there any interest in a PR that makes this explicit? It seems that especially when working with threads and work-stealing, this is something that users want to do.
The text was updated successfully, but these errors were encountered: