Adds the optional type of integer literals
@@ -15,7 +15,12 @@ impl Format for Literal {
// TODO: do more digging into `Literal` and see if there is more formatting to do.
Self::String(lit_string) => write!(formatted_code, "{}", lit_string.span.as_str())?,
Self::Char(lit_char) => write!(formatted_code, "{}", lit_char.span.as_str())?,
- Self::Int(lit_int) => write!(formatted_code, "{}", lit_int.span.as_str())?,
+ Self::Int(lit_int) => {
+ write!(formatted_code, "{}", lit_int.span.as_str())?;
+ if let Some((_, ty_span)) = &lit_int.ty_opt {
+ write!(formatted_code, "{}", ty_span.as_str())?;
+ }
+ }
Self::Bool(lit_bool) => write!(formatted_code, "{}", lit_bool.span.as_str())?,
}
Ok(())
