1 2 3 4 5 6 7 8 9 10 11 12 13
/// Unwrap an `Option<T>` in a `const` context. /// /// If it fails, panics with the given message. macro_rules! unwrap { ($val:expr, $msg:expr$(,)?) => { match $val { Some(val) => val, None => panic!($msg), } }; } pub(crate) use unwrap;