Use array IntoIter

This commit is contained in:
Laurențiu Nicola 2021-10-22 09:23:29 +03:00
parent 56fbf5d7b2
commit ca44b6892e
13 changed files with 33 additions and 32 deletions

View file

@ -283,7 +283,7 @@ pub fn mirror(input: TokenStream) -> TokenStream {
input
}
"#;
let proc_macros = std::array::IntoIter::new([
let proc_macros = [
ProcMacro {
name: "identity".into(),
kind: crate::ProcMacroKind::Attr,
@ -304,7 +304,8 @@ pub fn mirror(input: TokenStream) -> TokenStream {
kind: crate::ProcMacroKind::FuncLike,
expander: Arc::new(MirrorProcMacroExpander),
},
])
]
.into_iter()
.filter(|pm| proc_macros.iter().any(|name| name == pm.name))
.collect();
(proc_macros, source.into())