valust_utils::numeric

Function larger_than

Source
pub fn larger_than<T: PartialOrd>(a: T) -> impl Fn(T) -> bool
Expand description

Returns a closure that takes an argument and checks if it is less than the given value a.

This can be passed to #[valid] attribute like: #[valid(fn(larger_than(5))].