Okey - Everything is Result::Ok...
Ideally this crate should not be used used with the macro_rules_attribute
crate from Daniel Henry-Mantilla. So make sure to install that too...
cargo add macro_rules_attribute
Usage
extern crate macro_rules_attribute;
use okey;
In the example above my_name
will automatically return a Result::Ok
variant with "David"
as it's inner value.
Note that this won't work with "implicit returns", you need to explicitly put the return
keyword for this to work.
Returning an error
extern crate macro_rules_attribute;
use okey;