ordoo

Crates.ioordoo
lib.rsordoo
version0.1.1
sourcesrc
created_at2023-09-27 23:31:45.120223
updated_at2023-09-27 23:40:19.364851
descriptionMacro to allow early exit of control flow in Options and Results
homepage
repositoryhttps://github.com/ttocsneb/ordoo
max_upload_size
id985323
size4,276
Benjamin Jacobs (ttocsneb)

documentation

README

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.

Commit count: 2

cargo fmt