Macro ctx

Source
macro_rules! ctx {
    ($fmt:tt) => { ... };
    ($fmt:tt, $($arg:tt)*) => { ... };
}
Expand description

A shorter way to create a anyhow::Result with error context information

Instead of .with_context(|| anyhow!("while doing {}", 1 + 1)), this allows writing .map_err(ctx!("while doing {}", 1 + 1)).