Closed
Description
Given the following code: link
fn main() {
let x = Some(123);
// #1
if let Some(_) == x {}
// #2
if let x = Some(_) {}
// #3
if let x == Some(_) {}
// #4
if Some(_) = x {}
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: expected one of `=` or `|`, found `==`
--> src/main.rs:5:20
|
5 | if let Some(_) == x {}
| ^^ expected one of `=` or `|`
error: could not compile `playground` due to previous error
Ideally the output should suggest how to fix the syntax mistakes/typos for each of the above examples.
1 -> Remove extra =
2 -> Swap x
and Some(_)
3 -> 1 and 2
4 -> Add let