Skip to content

Commit 2edd0d2

Browse files
authored
Merge pull request RustPython#4325 from harupy/4324-follow-up
A follow-up for RustPython#4324
2 parents 0723271 + 6a0f13e commit 2edd0d2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

compiler/parser/src/string.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,18 @@ pub fn parse_strings(
8181
deduped.push(take_current(&mut current));
8282
}
8383

84-
let node = if has_fstring {
85-
ExprKind::JoinedStr { values: deduped }
84+
Ok(if has_fstring {
85+
Expr::new(
86+
initial_start,
87+
last_end,
88+
ExprKind::JoinedStr { values: deduped },
89+
)
8690
} else {
8791
deduped
8892
.into_iter()
8993
.exactly_one()
9094
.expect("String must be concatenated to a single element.")
91-
.node
92-
};
93-
Ok(Expr::new(initial_start, last_end, node))
95+
})
9496
}
9597

9698
#[cfg(test)]

0 commit comments

Comments
 (0)