diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/expr.rs | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 66a58efed..0f9ff97f1 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -617,7 +617,7 @@ impl Function { | |||
617 | self.data(db).name.clone() | 617 | self.data(db).name.clone() |
618 | } | 618 | } |
619 | 619 | ||
620 | pub(crate) fn body_source_map(self, db: &impl HirDatabase) -> Arc<BodySourceMap> { | 620 | pub fn body_source_map(self, db: &impl HirDatabase) -> Arc<BodySourceMap> { |
621 | db.body_with_source_map(self.into()).1 | 621 | db.body_with_source_map(self.into()).1 |
622 | } | 622 | } |
623 | 623 | ||
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 7cdc7555c..57225ae91 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -128,27 +128,27 @@ impl Index<PatId> for Body { | |||
128 | } | 128 | } |
129 | 129 | ||
130 | impl BodySourceMap { | 130 | impl BodySourceMap { |
131 | pub(crate) fn expr_syntax(&self, expr: ExprId) -> Option<SyntaxNodePtr> { | 131 | pub fn expr_syntax(&self, expr: ExprId) -> Option<SyntaxNodePtr> { |
132 | self.expr_map_back.get(expr).cloned() | 132 | self.expr_map_back.get(expr).cloned() |
133 | } | 133 | } |
134 | 134 | ||
135 | pub(crate) fn syntax_expr(&self, ptr: SyntaxNodePtr) -> Option<ExprId> { | 135 | pub fn syntax_expr(&self, ptr: SyntaxNodePtr) -> Option<ExprId> { |
136 | self.expr_map.get(&ptr).cloned() | 136 | self.expr_map.get(&ptr).cloned() |
137 | } | 137 | } |
138 | 138 | ||
139 | pub(crate) fn node_expr(&self, node: &ast::Expr) -> Option<ExprId> { | 139 | pub fn node_expr(&self, node: &ast::Expr) -> Option<ExprId> { |
140 | self.expr_map.get(&SyntaxNodePtr::new(node.syntax())).cloned() | 140 | self.expr_map.get(&SyntaxNodePtr::new(node.syntax())).cloned() |
141 | } | 141 | } |
142 | 142 | ||
143 | pub(crate) fn pat_syntax(&self, pat: PatId) -> Option<PatPtr> { | 143 | pub fn pat_syntax(&self, pat: PatId) -> Option<PatPtr> { |
144 | self.pat_map_back.get(pat).cloned() | 144 | self.pat_map_back.get(pat).cloned() |
145 | } | 145 | } |
146 | 146 | ||
147 | pub(crate) fn node_pat(&self, node: &ast::Pat) -> Option<PatId> { | 147 | pub fn node_pat(&self, node: &ast::Pat) -> Option<PatId> { |
148 | self.pat_map.get(&Either::A(AstPtr::new(node))).cloned() | 148 | self.pat_map.get(&Either::A(AstPtr::new(node))).cloned() |
149 | } | 149 | } |
150 | 150 | ||
151 | pub(crate) fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::RecordField> { | 151 | pub fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::RecordField> { |
152 | self.field_map[&(expr, field)] | 152 | self.field_map[&(expr, field)] |
153 | } | 153 | } |
154 | } | 154 | } |