move macros incorrectly moved out of utils to top level
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
8742266ff0
commit
cf59f738b9
2 changed files with 68 additions and 56 deletions
|
@ -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()
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue