refactor: remove redundant code

This commit is contained in:
naskya 2024-07-16 11:08:10 +09:00
parent b5fe39a3c3
commit dc9cc7aaa6
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -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() {