mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Avoid some Arc
cloning
This commit is contained in:
parent
eb17e90eba
commit
b8eb63f2b2
1 changed files with 2 additions and 2 deletions
|
@ -53,7 +53,7 @@ impl Hygiene {
|
||||||
pub fn local_inner_macros(&self, db: &dyn AstDatabase, path: ast::Path) -> Option<CrateId> {
|
pub fn local_inner_macros(&self, db: &dyn AstDatabase, path: ast::Path) -> Option<CrateId> {
|
||||||
let mut token = path.syntax().first_token()?.text_range();
|
let mut token = path.syntax().first_token()?.text_range();
|
||||||
let frames = self.frames.as_ref()?;
|
let frames = self.frames.as_ref()?;
|
||||||
let mut current = frames.0.clone();
|
let mut current = &frames.0;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let (mapped, origin) = current.expansion.as_ref()?.map_ident_up(db, token)?;
|
let (mapped, origin) = current.expansion.as_ref()?.map_ident_up(db, token)?;
|
||||||
|
@ -64,7 +64,7 @@ impl Hygiene {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
current = current.call_site.as_ref()?.clone();
|
current = current.call_site.as_ref()?;
|
||||||
token = mapped.value;
|
token = mapped.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue