iif

Crates.ioiif
lib.rsiif
version1.2.1
sourcesrc
created_at2021-04-12 11:12:09.376153
updated_at2021-04-12 11:41:44.810444
descriptionReturns one of two parts, depending on the evaluation of an expression.
homepage
repositoryhttps://github.com/hardliner66/iif
max_upload_size
id382342
size14,233
Steve Biedermann (hardliner66)

documentation

README

iif

Returns one of two parts, depending on the evaluation of an expression.

Straight form the days of VBA programming, now available in rust!

Crates.io

Examples

Use iif to decide between two values depending on a boolean expression.

use iif::iif;

let active = true;
let active_text = iif!(active, "Active", "Inactive");

assert_eq!(active_text, "Active");

Use iif_opt to create an Option depending on a boolean expression.

use iif::iif_opt;

let active = true;
let active_text = iif_opt!(active, "Active");

assert_eq!(active_text, Some("Active"));
Commit count: 11

cargo fmt