diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide_api/src/display/short_label.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/display/short_label.rs b/crates/ra_ide_api/src/display/short_label.rs index 6acb2ab92..ab67cc90c 100644 --- a/crates/ra_ide_api/src/display/short_label.rs +++ b/crates/ra_ide_api/src/display/short_label.rs | |||
@@ -70,23 +70,23 @@ fn short_label_from_ascribed_node<T>(node: &T, prefix: &str) -> Option<String> | |||
70 | where | 70 | where |
71 | T: NameOwner + VisibilityOwner + TypeAscriptionOwner, | 71 | T: NameOwner + VisibilityOwner + TypeAscriptionOwner, |
72 | { | 72 | { |
73 | let mut string = short_label_from_node(node, prefix)?; | 73 | let mut buf = short_label_from_node(node, prefix)?; |
74 | 74 | ||
75 | if let Some(type_ref) = node.ascribed_type() { | 75 | if let Some(type_ref) = node.ascribed_type() { |
76 | string.push_str(": "); | 76 | buf.push_str(": "); |
77 | type_ref.syntax().text().push_to(&mut string); | 77 | type_ref.syntax().text().push_to(&mut buf); |
78 | } | 78 | } |
79 | 79 | ||
80 | Some(string) | 80 | Some(buf) |
81 | } | 81 | } |
82 | 82 | ||
83 | fn short_label_from_node<T>(node: &T, label: &str) -> Option<String> | 83 | fn short_label_from_node<T>(node: &T, label: &str) -> Option<String> |
84 | where | 84 | where |
85 | T: NameOwner + VisibilityOwner, | 85 | T: NameOwner + VisibilityOwner, |
86 | { | 86 | { |
87 | let mut string = | 87 | let mut buf = |
88 | node.visibility().map(|v| format!("{} ", v.syntax().text())).unwrap_or_default(); | 88 | node.visibility().map(|v| format!("{} ", v.syntax().text())).unwrap_or_default(); |
89 | string.push_str(label); | 89 | buf.push_str(label); |
90 | string.push_str(node.name()?.text().as_str()); | 90 | buf.push_str(node.name()?.text().as_str()); |
91 | Some(string) | 91 | Some(buf) |
92 | } | 92 | } |