macro_rules! trying {
($e:expr) => { ... };
}Expand description
Return an iterator Err type conveniently
Examples
use rivia::prelude::*;
fn trying_func<T: AsRef<Path>>(vfs: Vfs, path: T) -> Option<RvResult<PathBuf>> {
Some(Ok(trying!(vfs.abs(path.as_ref()))))
}
let vfs = Vfs::memfs();
assert_eq!(trying_func(vfs, "").unwrap().unwrap_err().to_string(), "path empty");