mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
Rename some local variables
This commit is contained in:
parent
67e9ff7cc8
commit
2f7f4943e3
2 changed files with 23 additions and 22 deletions
|
@ -27,7 +27,7 @@ pub fn derive_impl(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream>
|
|||
let prefixes: Result<Vec<_>, _> = variant
|
||||
.attrs
|
||||
.iter()
|
||||
.filter(|a| a.path.is_ident("prefix"))
|
||||
.filter(|attr| attr.path.is_ident("prefix"))
|
||||
.map(|attr| {
|
||||
let Ok(Meta::NameValue(MetaNameValue{lit: Lit::Str(lit), ..})) = attr.parse_meta() else {
|
||||
return Err(Error::new(attr.span(), r#"expected attribute to be in the form of [#prefix = "..."]"#));
|
||||
|
@ -54,7 +54,7 @@ pub fn derive_impl(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream>
|
|||
));
|
||||
}
|
||||
|
||||
let Some(doc_attr) = variant.attrs.iter().find(|a| a.path.is_ident("doc")) else {
|
||||
let Some(doc_attr) = variant.attrs.iter().find(|attr| attr.path.is_ident("doc")) else {
|
||||
return Err(Error::new(variant.span(), r#"expected a doc comment"#))
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue