Closed
Description
Result and Option have map_or and map_or_else functions. In each case, the first parameter is used when the struct contains no value (or contains an error), while the second parameter is used when there is a value in the struct. The documentation mentions there parameters in the reverse order. This is confusing, as programmers expect parameter names to be documented in order.
I suggest reversing the wording.
I'll be submitting a PR with the change. If there are other classes or functions that have this issue, please leave a comment and I will change them as well.
Activity
[-]Arguments are described in the reverse order for map_or and map_or_else[/-][+]Docs: Arguments are described in the reverse order for map_or and map_or_else[/+]Reorder the parameter descriptions of map_or and map_or_else
Auto merge of rust-lang#84609 - lefth:master, r=Dylan-DPC
jyn514 commentedon Apr 27, 2021
Fixed in #84609.