Skip to content
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

map_or Documentation should note that the arguments are eagerly evaluated #68866

Closed
ShaneLillieRAD opened this issue Feb 5, 2020 · 1 comment · Fixed by #68886
Closed

map_or Documentation should note that the arguments are eagerly evaluated #68866

ShaneLillieRAD opened this issue Feb 5, 2020 · 1 comment · Fixed by #68886
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@ShaneLillieRAD
Copy link

ShaneLillieRAD commented Feb 5, 2020

Apologies if this isn't the appropriate repo to raise this issue on, I can close and re-create it wherever would be more appropriate.

It's a small thing, but in the documentation for both std::result::Result and std::option::Option it's noted that the *_or arguments are eagerly evaluated (with a suggestion to use the *_or_else for lazy evaluation) everywhere except for map_or. The behavior isn't super obvious up front if you're unfamiliar with that fact, but is very much important to know, so it would be nice if they were all consistent in that.

This issue has been assigned to @tom-a-wagner via this comment.

@Centril Centril added C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Feb 6, 2020
@tom-a-wagner
Copy link
Contributor

This seems more than easy enough for a first commit.

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants