macro_rules! constant2 {
($x:expr) => { ... };
}
Expand description
The constant function with two arguments constant2(x) = (_, _) -> x.
ยงExample
use rust2fun::prelude::*;
let actual = (1..4).reduce(constant2!(2));
assert_eq!(Some(2), actual);