mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-16 01:25:11 +00:00
Rename Parameter#arg
and ParameterWithDefault#def
fields (#6255)
## Summary This PR renames... - `Parameter#arg` to `Parameter#name` - `ParameterWithDefault#def` to `ParameterWithDefault#parameter` (such that `ParameterWithDefault` has a `default` and a `parameter`) ## Test Plan `cargo test`
This commit is contained in:
parent
adc8bb7821
commit
9c708d8fc1
56 changed files with 268 additions and 260 deletions
|
@ -381,7 +381,7 @@ pub struct ComparableParameter<'a> {
|
|||
impl<'a> From<&'a ast::Parameter> for ComparableParameter<'a> {
|
||||
fn from(arg: &'a ast::Parameter) -> Self {
|
||||
Self {
|
||||
arg: arg.arg.as_str(),
|
||||
arg: arg.name.as_str(),
|
||||
annotation: arg.annotation.as_ref().map(Into::into),
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ pub struct ComparableParameterWithDefault<'a> {
|
|||
impl<'a> From<&'a ast::ParameterWithDefault> for ComparableParameterWithDefault<'a> {
|
||||
fn from(arg: &'a ast::ParameterWithDefault) -> Self {
|
||||
Self {
|
||||
def: (&arg.def).into(),
|
||||
def: (&arg.parameter).into(),
|
||||
default: arg.default.as_ref().map(Into::into),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue