refactor: remove redundant code
This commit is contained in:
parent
b5fe39a3c3
commit
dc9cc7aaa6
1 changed files with 1 additions and 18 deletions
|
@ -11,24 +11,7 @@ fn derive_impl(input: syn::DeriveInput) -> syn::Result<TokenStream> {
|
|||
let orig_attrs: Vec<syn::Attribute> = input.attrs.clone().into_iter().collect();
|
||||
let relax_attrs: Vec<&syn::Attribute> = orig_attrs
|
||||
.iter()
|
||||
.filter(|attr| {
|
||||
if let syn::Attribute {
|
||||
meta:
|
||||
syn::Meta::List(syn::MetaList {
|
||||
path: syn::Path { segments, .. },
|
||||
..
|
||||
}),
|
||||
..
|
||||
} = attr
|
||||
{
|
||||
if segments.len() != 1 {
|
||||
return false;
|
||||
}
|
||||
matches!(&segments[0], syn::PathSegment { ident, .. } if ident == "relax")
|
||||
} else {
|
||||
false
|
||||
}
|
||||
})
|
||||
.filter(|attr| attr.path().is_ident("relax"))
|
||||
.collect();
|
||||
|
||||
if relax_attrs.is_empty() {
|
||||
|
|
Loading…
Reference in a new issue