wrap_ok

Macro wrap_ok 

Source
macro_rules! wrap_ok {
    ($e:expr) => { ... };
}
Expand description

Macro for ok-wrapping any Try type. This works on stable through dark type magic.

Note that type inference is very finicky; you should give this a type ascription ASAP.

let r: Result<_, ()> = wrap_ok!(1);
assert_eq!(r, Ok(1));