You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A small wrapper for `impl CtOption<T> for Option<T>` which is friendlier
for type inference purposes.
Using `Option::from(ct_option)` often doesn't work because the compiler
is unable to infer `T` for `Option<T>`, so you have to manually annotate
`Option::<T>::from`.
In practice this often winds up looking like:
Option::<T>::from(T::constructor(x))`
which feels quite redundant.
Using an inherent method instead fixes type inference so the above can
be:
T::constructor(x).into_option()
0 commit comments