toasty_core/stmt/entry_path.rs
1use super::{projection, Projection};
2
3pub trait EntryPath {
4 type Iter: Iterator<Item = usize>;
5
6 fn step_iter(self) -> Self::Iter;
7}
8
9impl EntryPath for usize {
10 type Iter = std::option::IntoIter<Self>;
11
12 fn step_iter(self) -> Self::Iter {
13 Some(self).into_iter()
14 }
15}
16
17impl<'a> EntryPath for &'a Projection {
18 type Iter = projection::Iter<'a>;
19
20 fn step_iter(self) -> Self::Iter {
21 self.into_iter()
22 }
23}