mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
Auto merge of #14035 - Veykril:ast-id-arg, r=Veykril
minor: Remove unnecessary arg in `LowerCtx::ast_id`
This commit is contained in:
commit
9814d79841
2 changed files with 3 additions and 3 deletions
|
@ -67,9 +67,9 @@ impl<'a> LowerCtx<'a> {
|
||||||
Path::from_src(ast, self)
|
Path::from_src(ast, self)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn ast_id<N: AstNode>(&self, db: &dyn DefDatabase, item: &N) -> Option<AstId<N>> {
|
pub(crate) fn ast_id<N: AstNode>(&self, item: &N) -> Option<AstId<N>> {
|
||||||
let &(file_id, ref ast_id_map) = self.ast_id_map.as_ref()?;
|
let &(file_id, ref ast_id_map) = self.ast_id_map.as_ref()?;
|
||||||
let ast_id_map = ast_id_map.get_or_init(|| db.ast_id_map(file_id));
|
let ast_id_map = ast_id_map.get_or_init(|| self.db.ast_id_map(file_id));
|
||||||
Some(InFile::new(file_id, ast_id_map.ast_id(item)))
|
Some(InFile::new(file_id, ast_id_map.ast_id(item)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ impl TypeRef {
|
||||||
TypeRef::DynTrait(type_bounds_from_ast(ctx, inner.type_bound_list()))
|
TypeRef::DynTrait(type_bounds_from_ast(ctx, inner.type_bound_list()))
|
||||||
}
|
}
|
||||||
ast::Type::MacroType(mt) => match mt.macro_call() {
|
ast::Type::MacroType(mt) => match mt.macro_call() {
|
||||||
Some(mc) => ctx.ast_id(ctx.db, &mc).map(TypeRef::Macro).unwrap_or(TypeRef::Error),
|
Some(mc) => ctx.ast_id(&mc).map(TypeRef::Macro).unwrap_or(TypeRef::Error),
|
||||||
None => TypeRef::Error,
|
None => TypeRef::Error,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue