Implement method into_ok_or_err for Result<T, T>
See original GitHub issueI think it’d be nice to be able to write something like
val a = res.map { it.joinToString("\n") }.into_ok_or_err()
instead of
val a = when (res) {
is Ok -> res.unwrap().joinToString("\n") // -> String
is Err -> res.unwrapError() // -> String
}
This feature already exists in Rust Nightly.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Untitled
A Rust Result<T, E> inspired interface for handling results. Result is a type that represents either success (Ok) or failure (Err).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Does this differ from merge?
No worries, here’s the wiki entry for it if that helps.