mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Use match
This commit is contained in:
1 parent
ebeb0904d4
commit
3a6729eedd
1 file changed
+1
-1
@@ -15,7 +15,7 @@ pub fn parse_strings(
|
||||
let initial_kind = (values[0].1 .1 == StringKind::U).then(|| "u".to_owned());
|
||||
|
||||
// Optimization: fast-track the common case of a single string.
|
||||
if values.len() == 1 && matches!(&values[0].1 .1, StringKind::Normal | StringKind::U) {
|
||||
if matches!(&*values, [(_, (_, StringKind::Normal | StringKind::U), _)]) {
|
||||
let value = values.into_iter().last().unwrap().1 .0;
|
||||
return Ok(Expr::new(
|
||||
initial_start,
|
||||
|
||||
Reference in new issue
Block a user