| 1184 | |
| 1185 | impl<I: Iterator> TreeNodeIterator for I { |
| 1186 | fn apply_until_stop<F: FnMut(Self::Item) -> Result<TreeNodeRecursion>>( |
| 1187 | self, |
| 1188 | mut f: F, |
| 1189 | ) -> Result<TreeNodeRecursion> { |
| 1190 | let mut tnr = TreeNodeRecursion::Continue; |
| 1191 | for i in self { |
| 1192 | tnr = f(i)?; |
| 1193 | match tnr { |
| 1194 | TreeNodeRecursion::Continue | TreeNodeRecursion::Jump => {} |
| 1195 | TreeNodeRecursion::Stop => return Ok(TreeNodeRecursion::Stop), |
| 1196 | } |
| 1197 | } |
| 1198 | Ok(tnr) |
| 1199 | } |
| 1200 | |
| 1201 | fn map_until_stop_and_collect< |
| 1202 | F: FnMut(Self::Item) -> Result<Transformed<Self::Item>>, |