const_unwrap

Function const_unwrap_result

Source
pub const fn const_unwrap_result<T: Copy, E: Copy + Debug>(
    opt: Result<T, E>,
) -> T
Expand description

Unwraps a Result’s Ok variant, or panics.

const_unwrap_result is a const fn, and may be called in a const context. Note that, if called from a non-const context, const_unwrap_result will execute at runtime, not at compile time.