Macro trackable::track_try_unwrap [−][src]
More human readable variant of the standard Result::unwrap
method.
Examples
#[macro_use] extern crate trackable; use trackable::error::{Failed, Failure, ErrorKindExt}; fn main() { let result: Result<(), Failure> = Err(Failed.error().into()); // Following two expressions are conceptually equivalent. result.clone().unwrap(); track_try_unwrap!(result.clone()); // `track_try_unwrap!()` can take additional arguments compatible to `format!()`. result.clone().expect(&format!("Additional information: {}", "foo")); track_try_unwrap!(result.clone(), "Additional information: {}", "foo"); }