better-returns
    Preparing search index...

    Function unwrap_error

    • Extracts the error value from an Err result, or returns a default error value if it's an Ok.

      Type Parameters

      • T

        The type of the successful value.

      • E

        The type of the error value.

      Parameters

      • result: Result<T, E>

        The result from which to unwrap the error value.

      • with_default: E

        The default error value to return if the result is Ok.

      Returns E

      The error value if result is Err, otherwise with_default.