File: macros_nested.rs

package info (click to toggle)
rust-async-recursion 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 332 kB
  • sloc: makefile: 2
file content (15 lines) | stat: -rw-r--r-- 341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
macro_rules! recurse {
    ($name:ident, $param:ty) => {
        #[::async_recursion::async_recursion]
        async fn $name<F>(param: $param, f: &F)
        where
            F: Fn($param) + Sync + Send,
        {
            f(param);
        }
    };
}

recurse!(owned, usize);
recurse!(by_ref, &usize);
recurse!(by_ref_mut, &mut usize);