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(); } }