macro_rules! from_infallible {
    ($ty:ty) => { ... };
}
Expand description

Utility macro for easily defining From<Infallible> for a given type.

Example

use core::convert::Infallible;
use aliri_braid::from_infallible;

pub struct MyType;

from_infallible!(MyType);

let result: Result<(), Infallible> = Ok(());
let my_result: Result<(), MyType> = result.map_err(MyType::from);