mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
internal: Shrink ProcMacroExpander from 8 to 4 bytes
This commit is contained in:
parent
54129fa113
commit
14dc1ac3bf
2 changed files with 14 additions and 11 deletions
|
@ -50,7 +50,7 @@ impl DeclarationLocation {
|
|||
pub fn original_name_range(&self, db: &dyn HirDatabase) -> Option<FileRange> {
|
||||
if let Some(file_id) = self.hir_file_id.file_id() {
|
||||
// fast path to prevent parsing
|
||||
return Some(FileRange { file_id, range: self.ptr.text_range() });
|
||||
return Some(FileRange { file_id, range: self.name_ptr.text_range() });
|
||||
}
|
||||
let node = resolve_node(db, self.hir_file_id, &self.name_ptr);
|
||||
node.as_ref().original_file_range_opt(db.upcast())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue