Skip to content

Commit

Permalink
Fix for Literal
Browse files Browse the repository at this point in the history
  • Loading branch information
pczarn committed Nov 23, 2023
1 parent 136f589 commit 3c2fa56
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tooling/nargo_fmt/src/visitor/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ impl FmtVisitor<'_> {
format_parens(None, self.fork(), exprs.len() == 1, exprs, span, false)
}
ExpressionKind::Literal(literal) => match literal {
Literal::Integer(_) | Literal::Bool(_) | Literal::Str(_) | Literal::FmtStr(_) => {
self.slice(span).to_string()
}
Literal::Integer(_)
| Literal::Bool(_)
| Literal::Str(_)
| Literal::RawStr(..)
| Literal::FmtStr(_) => self.slice(span).to_string(),
Literal::Array(ArrayLiteral::Repeated { repeated_element, length }) => {
let repeated = self.format_sub_expr(*repeated_element);
let length = self.format_sub_expr(*length);
Expand Down

0 comments on commit 3c2fa56

Please sign in to comment.