Open
Description
openedon Jan 20, 2019
Given this pseudocode
let result: bool = Ok(something) == some_function_returning_result();
It should be transformed to this pseudocode
let result: bool = match some_function_returning_result() {
Ok(something) => true,
_ => false,
};
Currently I get this error.
error[E0277]: can't compare `errors::Error` with `errors::Error`
--> src/rustup/toolchain.rs:349:35
|
349 | Ok(something) == some_function_returning_result()
| ^^ no implementation for `errors::Error == errors::Error`
|
= help: the trait `std::cmp::PartialEq` is not implemented for `errors::Error`
= note: required because of the requirements on the impl of `std::cmp::PartialEq` for `std::result::Result<std::string::String, errors::Error>`
It would be nice syntax sugar to have not only for Result
, but for any generic enum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Category: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.Relevant to the language team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.This change is large or controversial enough that it should have an RFC accepted before doing it.This change is large or controversial enough that it should have an RFC accepted before doing it.