Skip to main content

zyn_core/
ident.rs

1use proc_macro2::Ident;
2use proc_macro2::Span;
3
4pub struct Iter {
5    counter: usize,
6}
7
8impl Iter {
9    pub fn new() -> Self {
10        Self { counter: 0 }
11    }
12}
13
14impl Default for Iter {
15    fn default() -> Self {
16        Self::new()
17    }
18}
19
20impl Iterator for Iter {
21    type Item = Ident;
22
23    fn next(&mut self) -> Option<Self::Item> {
24        let id = Ident::new(&format!("__zyn_ts_{}", self.counter), Span::call_site());
25
26        self.counter += 1;
27        Some(id)
28    }
29}