diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-02-17 23:51:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-17 23:51:13 +0100 |
| commit | 40e3af5a2131f0f211e2f247faceae4008c94ec9 (patch) | |
| tree | 0e93f986dc71231a037752a1bad0f143a752a265 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | db59950b6d9dbadc4824e6dde841d1a085894c89 (diff) | |
| parent | 404da0bc901b92c2bf74a3c84fb0bd52cbf7f934 (diff) | |
| download | rust-40e3af5a2131f0f211e2f247faceae4008c94ec9.tar.gz rust-40e3af5a2131f0f211e2f247faceae4008c94ec9.zip | |
Rollup merge of #80572 - thomcc:ok_or_err, r=m-ou-se
Add a `Result::into_ok_or_err` method to extract a `T` from `Result<T, T>` When updating code to handle the semi-recent deprecation of `compare_and_swap` in favor of `compare_exchange`, which returns `Result<T, T>`, I wanted this. I've also wanted it with code using `slice::binary_search` before. The name (and perhaps the documentation) is the hardest part here, but this name seems consistent with the other Result methods, and equivalently memorable.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
