-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Option::map_or_else: Show an example of integrating with Result #111702
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
Option::map_or_else: Show an example of integrating with Result #111702
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
To summarize, this is just documenting an idiom for converting from |
This comment has been minimized.
This comment has been minimized.
Moving this from rust-lang/libs-team#59 where an API addition was rejected. But I think it's valuable to add this example to the documentation at least.
5f53341
to
440912b
Compare
@bors r+ rollup |
…result, r=Mark-Simulacrum Option::map_or_else: Show an example of integrating with Result Moving this from rust-lang/libs-team#59 where an API addition was rejected. But I think it's valuable to add this example to the documentation at least.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#111659 (suggest `Option::as_deref(_mut)` on type mismatch in option combinator if it passes typeck) - rust-lang#111702 (Option::map_or_else: Show an example of integrating with Result) - rust-lang#111878 (Fix codegen test suite for bare-metal-like targets) - rust-lang#111969 (bootstrap: Make `clean` respect `dry-run`) - rust-lang#111998 (Add other workspaces to `linkedProjects` in rust_analyzer_settings) - rust-lang#112215 (only suppress coercion error if type is definitely unsized) - rust-lang#112231 (Make sure the build.rustc version is either the same or 1 apart (revised)) r? `@ghost` `@rustbot` modify labels: rollup
Moving this from rust-lang/libs-team#59 where an API addition was rejected. But I think it's valuable to add this example to the documentation at least.