[−][src]Crate unwrap_all
Unpack multiple levels of Result<T, E>
and Option<T>
at once
use unwrap_all::unwrap_all; let nested: Option<Result<Option<Result<usize, ()>>, ()>> = Some(Ok(Some(Ok(42)))); let unpacked = unwrap_all!(4, nested); assert_eq!(42, unpacked);
This crate should work with no_std
too.
Macros
expect_all | Running this function will give you a panic with the message |
unwrap_all | Use it like this: |