unwrap_all

crates.io docs.rs

With this crate I would like to explore the ergonomics of being able to unwrap multiple levels with one call.

Example unwrapall!(ntimes, expression)

```rust use unwrapall::unwrapall;

let nested: Option

let unpacked = unwrap_all!(4, nested);

assert_eq!(42, unpacked); ```

Example expectall!(ntimes, message, expression)

Running this function will give you a panic with the message 1 - must fail: 23, where the 1 tells you how many levels in the panic was caused.

```rust use unwrapall::expectall;

fn mustfail() { let var = Some(Err::(23)); let _result: usize = expectall!(2, "must fail", var); } ```