mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Rename "string" to "buf"
This commit is contained in:
parent
41cb3fd758
commit
fc70275fed
1 changed files with 8 additions and 8 deletions
|
@ -70,23 +70,23 @@ fn short_label_from_ascribed_node<T>(node: &T, prefix: &str) -> Option<String>
|
||||||
where
|
where
|
||||||
T: NameOwner + VisibilityOwner + TypeAscriptionOwner,
|
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() {
|
if let Some(type_ref) = node.ascribed_type() {
|
||||||
string.push_str(": ");
|
buf.push_str(": ");
|
||||||
type_ref.syntax().text().push_to(&mut string);
|
type_ref.syntax().text().push_to(&mut buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(string)
|
Some(buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn short_label_from_node<T>(node: &T, label: &str) -> Option<String>
|
fn short_label_from_node<T>(node: &T, label: &str) -> Option<String>
|
||||||
where
|
where
|
||||||
T: NameOwner + VisibilityOwner,
|
T: NameOwner + VisibilityOwner,
|
||||||
{
|
{
|
||||||
let mut string =
|
let mut buf =
|
||||||
node.visibility().map(|v| format!("{} ", v.syntax().text())).unwrap_or_default();
|
node.visibility().map(|v| format!("{} ", v.syntax().text())).unwrap_or_default();
|
||||||
string.push_str(label);
|
buf.push_str(label);
|
||||||
string.push_str(node.name()?.text().as_str());
|
buf.push_str(node.name()?.text().as_str());
|
||||||
Some(string)
|
Some(buf)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue