diff --git a/src/ast.rs b/src/ast.rs index 50707e0..0d63d8e 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -130,16 +130,12 @@ impl AstDumper for StmtNode { condition, body, } => { - format!( - "( {}while {} {} )", - if let Some(label) = label { - &format!("@{} ", label.lexeme) - } else { - "" - }, - condition.dump(), - body.dump() - ) + let ltxt = if let Some(label) = label { + format!("@{} ", label.lexeme) + } else { + "".to_string() + }; + format!("( {}while {} {} )", ltxt, condition.dump(), body.dump()) } Self::LoopControlStmt {