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
{{ message }}
Repository navigation
Add implicit conversion to Result<TValue, TError> #9
Add implicit conversion operators allowing a plain TValue to be converted into Result<TValue, TError>.Likewise allow TError to be implicitly converted into Result<TValue, TError> as an Err variant.
Motivation
Improve ergonomics: callers can return values/errors directly without wrapping them in Result constructors.
Reduce boilerplate in functions that frequently return Result.
Examples
Before:
return new Result(value);
return new Result(error);
After:
return value; // converts to new(value)
return error; // converts to new(error)
Activity