aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/display
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/display')
-rw-r--r--crates/ra_ide/src/display/short_label.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs
index d8acb3be7..010c34705 100644
--- a/crates/ra_ide/src/display/short_label.rs
+++ b/crates/ra_ide/src/display/short_label.rs
@@ -61,15 +61,11 @@ impl ShortLabel for ast::TypeAlias {
61 61
62impl ShortLabel for ast::Const { 62impl ShortLabel for ast::Const {
63 fn short_label(&self) -> Option<String> { 63 fn short_label(&self) -> Option<String> {
64 match short_label_from_ty(self, self.ty(), "const ") { 64 let mut new_buf = short_label_from_ty(self, self.ty(), "const ")?;
65 Some(buf) => { 65 if let Some(expr) = self.body() {
66 let mut new_buf = buf; 66 format_to!(new_buf, " = {}", expr.syntax());
67 let body = self.body().unwrap();
68 format_to!(new_buf, " = {}", body.syntax());
69 Some(new_buf)
70 }
71 None => None,
72 } 67 }
68 Some(new_buf)
73 } 69 }
74} 70}
75 71