Open Xazax-hun opened 1 year ago
It could look something like, and similar for other types:
impl<'a, T: CfgBlock> IntoIterator for &'a T {
type Item = <T as CfgBlock>::Operation;
type IntoIter = std::slice::Iter<'a, Self::Item>;
fn into_iter(self) -> Self::IntoIter {
self.operations().iter()
}
}
Unfortunately, this violates the orphan rule.
Probably should try the extension trait pattern.
Instead of a blocks/elements etc method, consider IntoIterator? Can we have random access ones?