cheat_ensure

Macro cheat_ensure 

Source
macro_rules! cheat_ensure {
    (
        $cond:expr,
        protects = $protects:expr,
        severity = $severity:expr,
        cheats = [$($cheat:expr),+ $(,)?],
        consequence = $consequence:expr,
        $($arg:tt)*
    ) => { ... };
}
Expand description

Ensure a condition with cheat-aware error message.

Like anyhow::ensure!() but includes cheat documentation if the condition is false.

§Example

cheat_ensure!(
    partition_exists,
    protects = "Disk partitioning works",
    severity = "CRITICAL",
    cheats = ["Skip verification", "Accept any output"],
    consequence = "Installation fails",
    "Partition {} not found", "vda1"
);