10167: minor: Avoid extra allocation in completion rendering r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2021-09-06 15:15:10 +00:00 committed by GitHub
commit 7d9eb4fd73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,7 +101,7 @@ pub(crate) fn render_field(
.lookup_by(name.as_str());
let is_keyword = SyntaxKind::from_keyword(name.as_str()).is_some();
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) {
// FIXME