ordoo 0.1.1

Macro to allow early exit of control flow in Options and Results
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented2 out of 2 items with examples
  • Size
  • Source code size: 4.27 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 117.67 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ttocsneb/ordoo
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ttocsneb

docs.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.