Skip to content

Commit 7e67a18

Browse files
authored
Merge pull request rust-lang#18401 from Veykril/veykril/push-ulpowvsymyys
minor: Remove intermediate allocations
2 parents 3c75b4a + 38e9da2 commit 7e67a18

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/tools/rust-analyzer/crates/hir/src/symbols.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ impl<'a> SymbolCollector<'a> {
214214

215215
fn collect_from_impl(&mut self, impl_id: ImplId) {
216216
let impl_data = self.db.impl_data(impl_id);
217-
let impl_name =
218-
Some(SmolStr::new(impl_data.self_ty.display(self.db, self.edition).to_string()));
217+
let impl_name = Some(impl_data.self_ty.display(self.db, self.edition).to_smolstr());
219218
self.with_container_name(impl_name, |s| {
220219
for &assoc_item_id in impl_data.items.iter() {
221220
s.push_assoc_item(assoc_item_id)

src/tools/rust-analyzer/crates/ide-ssr/src/parsing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl RawPattern {
190190
let mut res = FxHashMap::default();
191191
for t in &self.tokens {
192192
if let PatternElement::Placeholder(placeholder) = t {
193-
res.insert(SmolStr::new(placeholder.stand_in_name.clone()), placeholder.clone());
193+
res.insert(SmolStr::new(&placeholder.stand_in_name), placeholder.clone());
194194
}
195195
}
196196
res

0 commit comments

Comments
 (0)