Closed
Description
fn main() {
match Some(0u32) {
Some(x) => {
x
},
None => {}
};
}
Errors:
Compiling playground v0.0.1 (/playground)
error[E0308]: match arms have incompatible types
--> src/main.rs:6:17
|
2 | / match Some(0u32) {
3 | | Some(x) => {
4 | | x
| | - this is found to be of type `_` <----------- this should be `u32`, removing the {} around x fixes it.
5 | | },
6 | | None => {}
| | ^^ expected u32, found ()
7 | | };
| |_____- `match` arms have incompatible types
|
= note: expected type `u32`
found type `()`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.