1 unstable release

0.1.0 Apr 17, 2021

#31 in #bool

MIT license

3KB

Or

Generic either-or type, similar to Result but more generic

Usage

fn get_foo_or_bar(b: bool) -> Or<Foo, Bar> {
    if b {
        Or::Left(Foo {})
    } else {
        Or::Right(Bar {})
    }
}

lib.rs:

Generic either-or type, similar to Result but more generic.

Usage

fn get_foo_or_bar(b: bool) -> Or<Foo, Bar> {
    if b {
        Or::Left(Foo {})
    } else {
        Or::Right(Bar {})
    }
}

No runtime deps