-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
stabilize Result::map_or #66570
stabilize Result::map_or #66570
Conversation
r? @Dylan-DPC |
r? @SimonSapin |
r? @sfackler |
r? @dtolnay |
7bbac33
to
1f3d350
Compare
Thanks @lzutao! This is a brand new API (#66292) but it is a sensible complement to Result::map_or_else which we have decided already to stabilize in 1.41.0 (#66322) and matches Option::map_or which has existed since 1.0.0. impl<T, E> Result<T, E> {
pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U {
match self {
Ok(t) => f(t),
Err(_) => default,
}
}
} @rfcbot fcp merge |
Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
☔ The latest upstream changes (presumably #66944) made this pull request unmergeable. Please resolve the merge conflicts. |
1f3d350
to
93438fd
Compare
@Amanieu @Kimundi @withoutboats waiting for your approval on this |
The changes in the PR look good to me as of 93438fd, r=me once the FCP is finished. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
@bors r+ |
📌 Commit 93438fd has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
…ylan-DPC stabilize Result::map_or r? @SimonSapin Closes rust-lang#66293
Rollup of 6 pull requests Successful merges: - #65778 (Stabilize `std::{rc,sync}::Weak::{weak_count, strong_count}`) - #66570 (stabilize Result::map_or) - #67206 (Update cargo, books) - #67285 (Indicate origin of where type parameter for uninferred types ) - #67317 (fix type_name_of_val doc comment) - #67324 (Fix repetition in matches/mod.rs) Failed merges: r? @ghost
…ylan-DPC stabilize Result::map_or r? @SimonSapin Closes rust-lang#66293
⌛ Testing commit 93438fd with merge 1cf33f4049982b6f42b97edf8185b36dee0b8b56... |
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
Rollup of 7 pull requests Successful merges: - #65778 (Stabilize `std::{rc,sync}::Weak::{weak_count, strong_count}`) - #66570 (stabilize Result::map_or) - #66735 (Add str::strip_prefix and str::strip_suffix) - #66771 (Stabilize the `core::panic` module) - #67317 (fix type_name_of_val doc comment) - #67324 (Fix repetition in matches/mod.rs) - #67325 (cleanup with push_fake_read) Failed merges: r? @ghost
@bors retry |
Rollup of 7 pull requests Successful merges: - #65778 (Stabilize `std::{rc,sync}::Weak::{weak_count, strong_count}`) - #66570 (stabilize Result::map_or) - #66735 (Add str::strip_prefix and str::strip_suffix) - #66771 (Stabilize the `core::panic` module) - #67317 (fix type_name_of_val doc comment) - #67324 (Fix repetition in matches/mod.rs) - #67325 (cleanup with push_fake_read) Failed merges: r? @ghost
r? @SimonSapin
Closes #66293