mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Simplify macro rendering, remove constructor structs
This commit is contained in:
parent
2b60d80eaf
commit
97f7865c56
3 changed files with 88 additions and 86 deletions
|
@ -47,8 +47,8 @@ impl<'a> RenderContext<'a> {
|
|||
self.completion.source_range()
|
||||
}
|
||||
|
||||
fn is_deprecated(&self, node: impl HasAttrs) -> bool {
|
||||
let attrs = node.attrs(self.db());
|
||||
fn is_deprecated(&self, def: impl HasAttrs) -> bool {
|
||||
let attrs = def.attrs(self.db());
|
||||
attrs.by_key("deprecated").exists() || attrs.by_key("rustc_deprecated").exists()
|
||||
}
|
||||
|
||||
|
@ -71,8 +71,8 @@ impl<'a> RenderContext<'a> {
|
|||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
fn docs(&self, node: impl HasAttrs) -> Option<hir::Documentation> {
|
||||
node.docs(self.db())
|
||||
fn docs(&self, def: impl HasAttrs) -> Option<hir::Documentation> {
|
||||
def.docs(self.db())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue