Crates.io | ifeq |
lib.rs | ifeq |
version | 0.1.3 |
source | src |
created_at | 2019-12-01 16:25:16.476089 |
updated_at | 2019-12-02 01:41:42.914529 |
description | Inline if then as generics |
homepage | https://github.com/mezeipetister/ifeq |
repository | https://github.com/mezeipetister/ifeq |
max_upload_size | |
id | 185740 |
size | 4,405 |
extern crate ifeq;
use ifeq::*;
assert_eq!(9.is(9).then_print("nine"), "nine");
assert_eq!(9.if_eq(9).then_print("nine"), "nine");
assert_eq!(9.if_eq(9).then(|| "nine"), "nine");