mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 13:33:31 +00:00
Avoid extra allocation in completion rendering
This commit is contained in:
parent
cbc13ae6bd
commit
d27ed8c243
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ pub(crate) fn render_field(
|
||||||
.lookup_by(name.as_str());
|
.lookup_by(name.as_str());
|
||||||
let is_keyword = SyntaxKind::from_keyword(name.as_str()).is_some();
|
let is_keyword = SyntaxKind::from_keyword(name.as_str()).is_some();
|
||||||
if is_keyword && !matches!(name.as_str(), "self" | "crate" | "super" | "Self") {
|
if is_keyword && !matches!(name.as_str(), "self" | "crate" | "super" | "Self") {
|
||||||
item.insert_text(String::from("r#") + name.as_str());
|
item.insert_text(format!("r#{}", name));
|
||||||
}
|
}
|
||||||
if let Some(_ref_match) = compute_ref_match(ctx.completion, ty) {
|
if let Some(_ref_match) = compute_ref_match(ctx.completion, ty) {
|
||||||
// FIXME
|
// FIXME
|
||||||
|
|
Loading…
Reference in a new issue