mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:24:57 +00:00
Code simplification
This commit is contained in:
parent
ec3520bbe4
commit
40ffa0c6da
1 changed files with 41 additions and 53 deletions
|
@ -1268,8 +1268,7 @@ impl<'db> Parameters<'db> {
|
||||||
method_type: method,
|
method_type: method,
|
||||||
class_type: class,
|
class_type: class,
|
||||||
}) = method_info
|
}) = method_info
|
||||||
{
|
&& !is_staticmethod
|
||||||
if !is_staticmethod
|
|
||||||
&& !is_classmethod
|
&& !is_classmethod
|
||||||
&& arg.parameter.annotation().is_none()
|
&& arg.parameter.annotation().is_none()
|
||||||
&& parameters.index(arg.name().id()) == Some(0)
|
&& parameters.index(arg.name().id()) == Some(0)
|
||||||
|
@ -1326,17 +1325,6 @@ impl<'db> Parameters<'db> {
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Parameter::from_node_and_kind(
|
|
||||||
db,
|
|
||||||
definition,
|
|
||||||
&arg.parameter,
|
|
||||||
ParameterKind::PositionalOrKeyword {
|
|
||||||
name: arg.parameter.name.id.clone(),
|
|
||||||
default_type: default_type(arg),
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let variadic = vararg.as_ref().map(|arg| {
|
let variadic = vararg.as_ref().map(|arg| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue