mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Reduce allocations in attribute collection
This commit is contained in:
parent
c08df0f1f5
commit
cc04cfc982
9 changed files with 61 additions and 70 deletions
|
@ -664,7 +664,7 @@ fn emit_def_diagnostic(db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>, diag:
|
|||
let attr = node
|
||||
.doc_comments_and_attrs()
|
||||
.nth((*invoc_attr_index) as usize)
|
||||
.and_then(Either::right)
|
||||
.and_then(Either::left)
|
||||
.unwrap_or_else(|| panic!("cannot find attribute #{}", invoc_attr_index));
|
||||
(
|
||||
ast_id.with_value(SyntaxNodePtr::from(AstPtr::new(&attr))),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue