Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/tt/src/lib.rs')
-rw-r--r--crates/tt/src/lib.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/tt/src/lib.rs b/crates/tt/src/lib.rs
index 85daec262c..353b09fd8c 100644
--- a/crates/tt/src/lib.rs
+++ b/crates/tt/src/lib.rs
@@ -115,15 +115,15 @@ fn print_debug_subtree(f: &mut fmt::Formatter<'_>, subtree: &Subtree, level: usi
let aux = match subtree.delimiter.map(|it| (it.kind, it.id.0)) {
None => "$".to_string(),
- Some((DelimiterKind::Parenthesis, id)) => format!("() {}", id),
- Some((DelimiterKind::Brace, id)) => format!("{{}} {}", id),
- Some((DelimiterKind::Bracket, id)) => format!("[] {}", id),
+ Some((DelimiterKind::Parenthesis, id)) => format!("() {id}"),
+ Some((DelimiterKind::Brace, id)) => format!("{{}} {id}"),
+ Some((DelimiterKind::Bracket, id)) => format!("[] {id}"),
};
if subtree.token_trees.is_empty() {
- write!(f, "{}SUBTREE {}", align, aux)?;
+ write!(f, "{align}SUBTREE {aux}")?;
} else {
- writeln!(f, "{}SUBTREE {}", align, aux)?;
+ writeln!(f, "{align}SUBTREE {aux}")?;
for (idx, child) in subtree.token_trees.iter().enumerate() {
print_debug_token(f, child, level + 1)?;
if idx != subtree.token_trees.len() - 1 {
@@ -140,7 +140,7 @@ fn print_debug_token(f: &mut fmt::Formatter<'_>, tkn: &TokenTree, level: usize)
match tkn {
TokenTree::Leaf(leaf) => match leaf {
- Leaf::Literal(lit) => write!(f, "{}LITERAL {} {}", align, lit.text, lit.id.0)?,
+ Leaf::Literal(lit) => write!(f, "{align}LITERAL {} {}", lit.text, lit.id.0)?,
Leaf::Punct(punct) => write!(
f,
"{}PUNCH {} [{}] {}",
@@ -149,7 +149,7 @@ fn print_debug_token(f: &mut fmt::Formatter<'_>, tkn: &TokenTree, level: usize)
if punct.spacing == Spacing::Alone { "alone" } else { "joint" },
punct.id.0
)?,
- Leaf::Ident(ident) => write!(f, "{}IDENT {} {}", align, ident.text, ident.id.0)?,
+ Leaf::Ident(ident) => write!(f, "{align}IDENT {} {}", ident.text, ident.id.0)?,
},
TokenTree::Subtree(subtree) => {
print_debug_subtree(f, subtree, level)?;
@@ -312,7 +312,7 @@ pub fn pretty(tkns: &[TokenTree]) -> String {
Some(DelimiterKind::Parenthesis) => ("(", ")"),
Some(DelimiterKind::Bracket) => ("[", "]"),
};
- format!("{}{}{}", open, content, close)
+ format!("{open}{content}{close}")
}
}
}