Macro rust2fun::constant

source ·
macro_rules! constant {
    ($x:expr) => { ... };
}
Expand description

The constant with no arguments constant(x) = () -> x.

Example

use rust2fun::prelude::*;

let f = constant!(42);
assert_eq!(42, f());