#options #macro #tell

is_option

Tell you if your type is an Option<_>

1 unstable release

0.1.0 Jan 5, 2023

#7 in #tell

MIT/Apache

3KB

Is my type an Option?

use is_option::is_option;

assert!(is_option!(Option<bool>));
assert!(is_option!(Option<String>));
assert!(is_option!(Option<&str>));

assert!(!is_option!(bool));
assert!(!is_option!(&str));
assert!(!is_option!(Vec<usize>));

No runtime deps