Search the provided `Expr`'s, and all of their nested `Expr`, for any that pass the provided test. The returned `Expr`'s are deduplicated and returned in order of appearance (depth first).
(
exprs: impl IntoIterator<Item = &'a Expr>,
test_fn: &F,
)
| 672 | /// pass the provided test. The returned `Expr`'s are deduplicated and returned |
| 673 | /// in order of appearance (depth first). |
| 674 | fn find_exprs_in_exprs<'a, F>( |
| 675 | exprs: impl IntoIterator<Item = &'a Expr>, |
| 676 | test_fn: &F, |
| 677 | ) -> Vec<Expr> |
| 678 | where |
| 679 | F: Fn(&Expr) -> bool, |
| 680 | { |
| 681 | exprs |
| 682 | .into_iter() |
| 683 | .flat_map(|expr| find_exprs_in_expr(expr, test_fn)) |
| 684 | .fold(vec![], |mut acc, expr| { |
| 685 | if !acc.contains(&expr) { |
| 686 | acc.push(expr) |
| 687 | } |
| 688 | acc |
| 689 | }) |
| 690 | } |
| 691 | |
| 692 | /// Search an `Expr`, and all of its nested `Expr`'s, for any that pass the |
| 693 | /// provided test. The returned `Expr`'s are deduplicated and returned in order |
no test coverage detected
searching dependent graphs…