Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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()
- Loading branch information