cbit 0.1.1

A proc-macro to use callback-based iterators with `for`-loop syntax and functionality
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::ops::ControlFlow;

use cbit::cbit;

fn main() {
    cbit!(for _ in Demo.method::<_>() {
        println!("We ran!");
    });
}

struct Demo;

impl Demo {
    pub fn method<B>(&self, f: impl FnOnce(()) -> ControlFlow<B>) -> ControlFlow<B> {
        f(())
    }
}