mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:21 +00:00
[ruff
] Fix false negative for empty f-strings in deque
calls (RUF037
) (#20109)
## Summary Fixes #20050
This commit is contained in:
parent
b6522cb534
commit
26082e8ec1
4 changed files with 24 additions and 2 deletions
|
@ -1406,7 +1406,7 @@ fn is_non_empty_f_string(expr: &ast::ExprFString) -> bool {
|
|||
|
||||
/// Returns `true` if the expression definitely resolves to the empty string, when used as an f-string
|
||||
/// expression.
|
||||
fn is_empty_f_string(expr: &ast::ExprFString) -> bool {
|
||||
pub fn is_empty_f_string(expr: &ast::ExprFString) -> bool {
|
||||
fn inner(expr: &Expr) -> bool {
|
||||
match expr {
|
||||
Expr::StringLiteral(ast::ExprStringLiteral { value, .. }) => value.is_empty(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue