better-returns
    Preparing search index...

    Function unwrap

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

      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 value.

      • with_default: T

        The default value to return if the result is an Err.

      Returns T

      The successful value if result is Ok, otherwise with_default.