-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Documentation on Result::map_or_else
uses very unfortunate wording
#88195
Comments
@orlp are you interested in making a PR to fix it? :) there are instructions in https://rustc-dev-guide.rust-lang.org/getting-started.html#building-and-testing-stdcorealloctestproc_macroetc |
I could, but I think I'd prefer to bikeshed a bit first as to how it should be described. |
To me these functions are so confusing that I practically never use them, the arguments are in the wrong order ... as repeatedly noted in both the tracking issue and stabilization PR that added it. It can't be changed, of course :/ I rather like the way it's documented in the corresponding method on |
How about
It explains in the same order as the function name ( |
Made a pull request using @mdsn 's suggestion, only replacing "applying |
…aahc Fixed confusing wording on Result::map_or_else. Fixes rust-lang#88195.
…aahc Fixed confusing wording on Result::map_or_else. Fixes rust-lang#88195.
The type signature of
Result::map_or_else
:Note how
default
is the function that gets applied to theErr
variant. Then, the docstring (emphasis mine):I think this is a very unfortunate choice of words and should be changed.
The text was updated successfully, but these errors were encountered: