Why are From and Into not implemented for Option?
It would be pretty easy to add something like
impl<F, T: From<F>> From<Option<F>> for Option<T> {
fn from(value: Option<F>) -> Self {
value.map(Into::into)
}
}
to the standard library. Same could be the case for Result
in case anyone is wondering why i need this, im working with sqlx and its macros require the struct field type to implement From<T> (where T is the SQL column type equivalent in rust). I wrapped i32 and i64 into newtypes, but Options of these newtypes dont implement From, making it impossible to use them.
edit: removed unnecessary lambda function