mirror of https://github.com/astral-sh/ruff
Refactor
This commit is contained in:
parent
99b02be35a
commit
3abdc87076
|
|
@ -81,16 +81,18 @@ pub fn parse_strings(
|
||||||
deduped.push(take_current(&mut current));
|
deduped.push(take_current(&mut current));
|
||||||
}
|
}
|
||||||
|
|
||||||
let node = if has_fstring {
|
Ok(if has_fstring {
|
||||||
ExprKind::JoinedStr { values: deduped }
|
Expr::new(
|
||||||
|
initial_start,
|
||||||
|
last_end,
|
||||||
|
ExprKind::JoinedStr { values: deduped },
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
deduped
|
deduped
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.exactly_one()
|
.exactly_one()
|
||||||
.expect("String must be concatenated to a single element.")
|
.expect("String must be concatenated to a single element.")
|
||||||
.node
|
})
|
||||||
};
|
|
||||||
Ok(Expr::new(initial_start, last_end, node))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue