[][src]Function fatal::unwrap

pub fn unwrap<T, E: Display>(result: Result<T, E>) -> T

Unwraps a result or reports its error and exits.

The error is reported with error!.

See UnwrapExt for an extension trait version.

User Experience

Be mindful to not be too lazy because error values usually don't have the context to report even remotely acceptable messages. If context wasn't provided or isn't otherwise obvious, you should probably use expect!.