Function try_opt

Source
pub fn try_opt<T>(value: Option<T>, error_message: &str) -> T
Expand description

Attempts to unwrap an Option. If it’s a None, exit program with given error message.