mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 15:14:19 -05:00
Extend reimplemented-starmap (FURB140) to catch calls with a single and starred argument (#7768)
This commit is contained in:
@@ -927,11 +927,7 @@ impl<'a> From<&'a ast::Expr> for ComparableExpr<'a> {
|
||||
}) => Self::Starred(ExprStarred {
|
||||
value: value.into(),
|
||||
}),
|
||||
ast::Expr::Name(ast::ExprName {
|
||||
id,
|
||||
ctx: _,
|
||||
range: _,
|
||||
}) => Self::Name(ExprName { id: id.as_str() }),
|
||||
ast::Expr::Name(name) => name.into(),
|
||||
ast::Expr::List(ast::ExprList {
|
||||
elts,
|
||||
ctx: _,
|
||||
@@ -968,6 +964,14 @@ impl<'a> From<&'a ast::Expr> for ComparableExpr<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a ast::ExprName> for ComparableExpr<'a> {
|
||||
fn from(expr: &'a ast::ExprName) -> Self {
|
||||
Self::Name(ExprName {
|
||||
id: expr.id.as_str(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||
pub struct StmtFunctionDef<'a> {
|
||||
is_async: bool,
|
||||
|
||||
Reference in New Issue
Block a user