Closed
Description
Currently
let i: i32 = Some(42);
reports
2 | let i: i32 = Some(42);
| ^^^^^^^^ expected i32, found enum `std::option::Option`
|
= note: expected type `i32`
found type `std::option::Option<{integer}>`
= help: here are some functions which might fulfill your needs:
- .unwrap()
- .unwrap_or_default()
I think Option
and Result
are special enough to warrant customized error messages. In this case simply suggesting to remove the Some