diff --git a/compiler/parser/src/string.rs b/compiler/parser/src/string.rs index cf18de9c2c..b80c6298c9 100644 --- a/compiler/parser/src/string.rs +++ b/compiler/parser/src/string.rs @@ -81,16 +81,18 @@ pub fn parse_strings( deduped.push(take_current(&mut current)); } - let node = if has_fstring { - ExprKind::JoinedStr { values: deduped } + Ok(if has_fstring { + Expr::new( + initial_start, + last_end, + ExprKind::JoinedStr { values: deduped }, + ) } else { deduped .into_iter() .exactly_one() .expect("String must be concatenated to a single element.") - .node - }; - Ok(Expr::new(initial_start, last_end, node)) + }) } #[cfg(test)]