From 8e09d487c3df3ecee1619f1314ecce7be52454a8 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 2 Dec 2024 03:46:05 -0500 Subject: [PATCH] Fix token list display --- dust-lang/src/token.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dust-lang/src/token.rs b/dust-lang/src/token.rs index 4d3e48c..385effc 100644 --- a/dust-lang/src/token.rs +++ b/dust-lang/src/token.rs @@ -17,12 +17,13 @@ pub fn write_token_list(tokens: &[(Token, Span)], styled: bool, writer for (token, position) in tokens { let token = if styled { - format!("{:^13}", token.to_string().bold()) + format!("{:^13}", token.as_str().bold()) } else { - format!("{token:^13}") + token.to_string() }; + let position = position.to_string(); - writeln!(writer, "{token} {position:<10}").unwrap(); + writeln!(writer, "{token:^13} {position:^10}").unwrap(); } }