Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/expr_store.rs')
| -rw-r--r-- | crates/hir-def/src/expr_store.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/hir-def/src/expr_store.rs b/crates/hir-def/src/expr_store.rs index 05c220d223..eb66e592d6 100644 --- a/crates/hir-def/src/expr_store.rs +++ b/crates/hir-def/src/expr_store.rs @@ -282,6 +282,9 @@ impl ExpressionStore { } } + /// Walks the immediate children expressions and calls `f` for each child expression. + /// + /// Note that this does not walk const blocks. pub fn walk_child_exprs(&self, expr_id: ExprId, mut f: impl FnMut(ExprId)) { let expr = &self[expr_id]; match expr { @@ -415,6 +418,10 @@ impl ExpressionStore { } } + /// Walks the immediate children expressions and calls `f` for each child expression but does + /// not walk expressions within patterns. + /// + /// Note that this does not walk const blocks. pub fn walk_child_exprs_without_pats(&self, expr_id: ExprId, mut f: impl FnMut(ExprId)) { let expr = &self[expr_id]; match expr { |