const-anonymous-functions 1.1.0

Simple macro to create const anonymous functions
Documentation
1
2
3
4
5
6
7
8
9
10
#![cfg(test)]

use crate::caf;

#[test]
fn test_const_anon_functions() {
    const RESULT: i32 = caf!(|a: i32, b: i32| -> i32 { a + b })(1, 2);

    assert_eq!(RESULT, 1 + 2);
}