mirror of
https://github.com/arcan1s/result.git
synced 2025-04-24 07:27:18 +00:00
return result on recover
This commit is contained in:
parent
f1247cd010
commit
b2f6093076
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user