Macro rust2fun::constant2

source ·
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);