aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/display
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/display')
-rw-r--r--crates/ide/src/display/navigation_target.rs3
-rw-r--r--crates/ide/src/display/short_label.rs4
2 files changed, 3 insertions, 4 deletions
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 {
153 node: InFile<&dyn ast::NameOwner>, 153 node: InFile<&dyn ast::NameOwner>,
154 kind: SymbolKind, 154 kind: SymbolKind,
155 ) -> NavigationTarget { 155 ) -> NavigationTarget {
156 let name = 156 let name = node.value.name().map(|it| it.text().into()).unwrap_or_else(|| "_".into());
157 node.value.name().map(|it| it.text().clone()).unwrap_or_else(|| SmolStr::new("_"));
158 let focus_range = 157 let focus_range =
159 node.value.name().map(|it| node.with_value(it.syntax()).original_file_range(db).range); 158 node.value.name().map(|it| node.with_value(it.syntax()).original_file_range(db).range);
160 let frange = node.map(|it| it.syntax()).original_file_range(db); 159 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 {
90impl ShortLabel for ast::ConstParam { 90impl ShortLabel for ast::ConstParam {
91 fn short_label(&self) -> Option<String> { 91 fn short_label(&self) -> Option<String> {
92 let mut buf = "const ".to_owned(); 92 let mut buf = "const ".to_owned();
93 buf.push_str(self.name()?.text().as_str()); 93 buf.push_str(self.name()?.text());
94 if let Some(type_ref) = self.ty() { 94 if let Some(type_ref) = self.ty() {
95 format_to!(buf, ": {}", type_ref.syntax()); 95 format_to!(buf, ": {}", type_ref.syntax());
96 } 96 }
@@ -117,6 +117,6 @@ where
117{ 117{
118 let mut buf = node.visibility().map(|v| format!("{} ", v.syntax())).unwrap_or_default(); 118 let mut buf = node.visibility().map(|v| format!("{} ", v.syntax())).unwrap_or_default();
119 buf.push_str(label); 119 buf.push_str(label);
120 buf.push_str(node.name()?.text().as_str()); 120 buf.push_str(node.name()?.text());
121 Some(buf) 121 Some(buf)
122} 122}