mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
Minor refactoring
This commit is contained in:
parent
4b0d423b57
commit
2b3aec132d
1 changed files with 2 additions and 4 deletions
|
@ -1235,14 +1235,12 @@ impl<'db> Parameters<'db> {
|
||||||
{
|
{
|
||||||
let method_has_self_in_generic_context =
|
let method_has_self_in_generic_context =
|
||||||
method.signature(db).overloads.iter().any(|s| {
|
method.signature(db).overloads.iter().any(|s| {
|
||||||
if let Some(context) = s.generic_context {
|
s.generic_context.is_some_and(|context| {
|
||||||
context
|
context
|
||||||
.variables(db)
|
.variables(db)
|
||||||
.iter()
|
.iter()
|
||||||
.any(|v| v.typevar(db).is_self(db))
|
.any(|v| v.typevar(db).is_self(db))
|
||||||
} else {
|
})
|
||||||
false
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if method_has_self_in_generic_context
|
if method_has_self_in_generic_context
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue