Trait easy_shortcuts::traits::Die
[−]
[src]
pub trait Die<T> { fn or_die(self, msg: &str) -> T; }
Perl-like 'die' quit on error
Required Methods
fn or_die(self, msg: &str) -> T
this is like expect
but quits with non-zero code
instead of panicking. Defined for Option
extern crate easy_shortcuts; use easy_shortcuts::traits::Die; use std::env; let = env::home_dir().or_die("no home!");