move macros incorrectly moved out of utils to top level

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-25 02:01:29 +00:00
parent 8742266ff0
commit cf59f738b9
2 changed files with 68 additions and 56 deletions

View file

@ -36,59 +36,3 @@ pub mod mods {
() => {};
}
}
/// Functor for falsy
#[macro_export]
macro_rules! is_false {
() => {
|x| !x
};
}
/// Functor for truthy
#[macro_export]
macro_rules! is_true {
() => {
|x| !!x
};
}
/// Functor for equality to zero
#[macro_export]
macro_rules! is_zero {
() => {
$crate::is_matching!(0)
};
}
/// Functor for equality i.e. .is_some_and(is_equal!(2))
#[macro_export]
macro_rules! is_equal_to {
($val:expr) => {
|x| x == $val
};
}
/// Functor for less i.e. .is_some_and(is_less_than!(2))
#[macro_export]
macro_rules! is_less_than {
($val:expr) => {
|x| x < $val
};
}
/// Functor for matches! i.e. .is_some_and(is_matching!('A'..='Z'))
#[macro_export]
macro_rules! is_matching {
($val:expr) => {
|x| matches!(x, $val)
};
}
/// Functor for !is_empty()
#[macro_export]
macro_rules! is_not_empty {
() => {
|x| !x.is_empty()
};
}