mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
40e3af5a21
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. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |