From 46b4f89c920c314caf1a8af2abdb09732d100d67 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 Jan 2021 01:56:11 +0300 Subject: . --- crates/ide/src/display/navigation_target.rs | 3 +-- crates/ide/src/display/short_label.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ide/src/display') diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index 00e601244..671aa1373 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs @@ -153,8 +153,7 @@ impl NavigationTarget { node: InFile<&dyn ast::NameOwner>, kind: SymbolKind, ) -> NavigationTarget { - let name = - node.value.name().map(|it| it.text().clone()).unwrap_or_else(|| SmolStr::new("_")); + let name = node.value.name().map(|it| it.text().into()).unwrap_or_else(|| "_".into()); let focus_range = node.value.name().map(|it| node.with_value(it.syntax()).original_file_range(db).range); let frange = node.map(|it| it.syntax()).original_file_range(db); diff --git a/crates/ide/src/display/short_label.rs b/crates/ide/src/display/short_label.rs index 990f740b8..b8e4cc181 100644 --- a/crates/ide/src/display/short_label.rs +++ b/crates/ide/src/display/short_label.rs @@ -90,7 +90,7 @@ impl ShortLabel for ast::Variant { impl ShortLabel for ast::ConstParam { fn short_label(&self) -> Option { let mut buf = "const ".to_owned(); - buf.push_str(self.name()?.text().as_str()); + buf.push_str(self.name()?.text()); if let Some(type_ref) = self.ty() { format_to!(buf, ": {}", type_ref.syntax()); } @@ -117,6 +117,6 @@ where { let mut buf = node.visibility().map(|v| format!("{} ", v.syntax())).unwrap_or_default(); buf.push_str(label); - buf.push_str(node.name()?.text().as_str()); + buf.push_str(node.name()?.text()); Some(buf) } -- cgit v1.2.3