From 2dfb5e6ac03e9cc6973dffe9ad69e858510604ee Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 7 Jan 2019 00:03:30 +0100 Subject: Improve types for node_expr / node_pat --- crates/ra_hir/src/expr.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 69144e94f..b0063cad2 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs @@ -5,7 +5,7 @@ use rustc_hash::FxHashMap; use ra_arena::{Arena, RawId, impl_arena_id, map::ArenaMap}; use ra_db::{LocalSyntaxPtr, Cancelable}; -use ra_syntax::{SyntaxNodeRef, ast::{self, AstNode, LoopBodyOwner, ArgListOwner, NameOwner}}; +use ra_syntax::ast::{self, AstNode, LoopBodyOwner, ArgListOwner, NameOwner}; use crate::{Path, type_ref::{Mutability, TypeRef}, Name, HirDatabase, DefId, Def, name::AsName}; @@ -77,9 +77,9 @@ impl BodySyntaxMapping { pub fn syntax_expr(&self, ptr: LocalSyntaxPtr) -> Option { self.expr_syntax_mapping.get(&ptr).cloned() } - pub fn node_expr(&self, node: SyntaxNodeRef) -> Option { + pub fn node_expr(&self, node: ast::Expr) -> Option { self.expr_syntax_mapping - .get(&LocalSyntaxPtr::new(node)) + .get(&LocalSyntaxPtr::new(node.syntax())) .cloned() } pub fn pat_syntax(&self, pat: PatId) -> Option { @@ -88,9 +88,9 @@ impl BodySyntaxMapping { pub fn syntax_pat(&self, ptr: LocalSyntaxPtr) -> Option { self.pat_syntax_mapping.get(&ptr).cloned() } - pub fn node_pat(&self, node: SyntaxNodeRef) -> Option { + pub fn node_pat(&self, node: ast::Pat) -> Option { self.pat_syntax_mapping - .get(&LocalSyntaxPtr::new(node)) + .get(&LocalSyntaxPtr::new(node.syntax())) .cloned() } -- cgit v1.2.3