diff --git a/parser/src/string.rs b/parser/src/string.rs index cf18de9..b80c629 100644 --- a/parser/src/string.rs +++ b/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)]