From fc70275fedc4edd7c53003d93df8826046591951 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 10 Jun 2019 03:30:03 +0800 Subject: Rename "string" to "buf" --- crates/ra_ide_api/src/display/short_label.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_ide_api') 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(node: &T, prefix: &str) -> Option where T: NameOwner + VisibilityOwner + TypeAscriptionOwner, { - let mut string = short_label_from_node(node, prefix)?; + let mut buf = short_label_from_node(node, prefix)?; if let Some(type_ref) = node.ascribed_type() { - string.push_str(": "); - type_ref.syntax().text().push_to(&mut string); + buf.push_str(": "); + type_ref.syntax().text().push_to(&mut buf); } - Some(string) + Some(buf) } fn short_label_from_node(node: &T, label: &str) -> Option where T: NameOwner + VisibilityOwner, { - let mut string = + let mut buf = node.visibility().map(|v| format!("{} ", v.syntax().text())).unwrap_or_default(); - string.push_str(label); - string.push_str(node.name()?.text().as_str()); - Some(string) + buf.push_str(label); + buf.push_str(node.name()?.text().as_str()); + Some(buf) } -- cgit v1.2.3