2 releases
0.1.1 | Sep 27, 2023 |
---|---|
0.1.0 | Sep 27, 2023 |
#1555 in Development tools
4KB
This crate simply adds a macro that makes the syntax simpler to end control flow.
The macro or_do will allow you to return a function early if a value is None or Err.
use ordoo::or_do;
let val: i32 = or_do!(Some(1), return);
let val: i32 = or_do!(Ok::<_, std::io::Error>(1), _ => return);
I may add more QoL macros/functions later.
lib.rs
:
This crate simply adds a macro that makes the syntax simpler to end control flow.
The macro [or_do] will allow you to return a function early if a value is None or Err.
use ordoo::or_do;
let val: i32 = or_do!(Some(1), return);
let val: i32 = or_do!(Ok::<_, std::io::Error>(1), _ => return);
I may add more QoL macros/functions later.