2 ms·
As the error says, = note: expected type `std::option::Option<u8>` found type `std::option::Option<std::option::Option<_>>` The return types of
by steveklabnik 9y ago
As the error says,
= note: expected type `std::option::Option<u8>`
found type `std::option::Option<std::option::Option<_>>`
The return types of those functions are Option<u8>, but Some(None) is an Option<Option<_>>.
> there's now a NoneError?
It's not stable yet.
> now all matches will have to explicitly be updated to check for NoneError
NoneError only comes into play when you have a function that returns Result, but uses ? on an Option in the body. That code never compiled (and still doesn't on stable until Try is stabilized, and only if you have Result<T, NoneError> as your return type or some Err type that implements From<NoneError>, which you also can't write until it's stable.
Does that help?
- alfiedotwtf 9y agoAh, awesome. Makes total sense now. Thanks!