Transforms the successful value of a Result using a mapping function.
If the result is Ok, the apply function is called with its value, and a new Ok result
containing the transformed value is returned. If the result is Err, it is returned unchanged.
Type Parameters
T
The original type of the successful value.
E
The type of the error value.
U
The new type of the successful value after transformation.
Transforms the successful value of a
Result
using a mapping function. If the result isOk
, theapply
function is called with its value, and a newOk
result containing the transformed value is returned. If the result isErr
, it is returned unchanged.