mirror of
https://github.com/arcan1s/result.git
synced 2025-07-13 21:45:47 +00:00
return result on recover
This commit is contained in:
@ -219,9 +219,9 @@ public:
|
||||
* otherwise
|
||||
*/
|
||||
template <typename UnaryFunctionError>
|
||||
T recover(UnaryFunctionError apply_error) const
|
||||
Result<T, ErrorEnum> recover(UnaryFunctionError apply_error) const
|
||||
{
|
||||
T val;
|
||||
Result<T, ErrorEnum> val;
|
||||
match([&val](T value) { val = value; },
|
||||
[&val, &apply_error](Error<ErrorEnum> error) {
|
||||
val = apply_error(error);
|
||||
|
Reference in New Issue
Block a user