rust/library/core
Dylan DPC 40e3af5a21
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.
2021-02-17 23:51:13 +01:00
..
benches Add more benchmarks 2021-01-08 09:50:35 +00:00
src Rollup merge of #80572 - thomcc:ok_or_err, r=m-ou-se 2021-02-17 23:51:13 +01:00
tests Rename Result::ok_or_err to Result::into_ok_or_err 2021-02-17 08:54:52 -08:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00