-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Description
I think it's better in general for the standard docs to contain examples that are easy to understand, but are also realistic usages of functions and features. An example of this is in slice::binary_search that shows how to insert an item to a sorted vector while maintaining sort order.
So I think the docs of Iterator::reduce could be improved with a more real usage example (to replace the current find_max example). And I think such docs should also say that reduce is useful when your binary operation doesn't have an identity element (or when you don't want to use it for some reason, like efficiency, etc).
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools