Fix clippy warnings

This commit is contained in:
Devin Ragotzy 2020-08-05 18:14:47 -04:00 committed by Jonas Platte
parent 2beaf450a3
commit 80237d6dd1

View File

@ -47,16 +47,6 @@ pub fn copy_lifetime_ident(lifetimes: &mut BTreeSet<Lifetime>, ty: &Type) {
}
}
/// Collects the unique lifetime identifiers from the struct declaration.
pub fn collect_generic_idents<'a, I: Iterator<Item = &'a Type>>(iter: I) -> TokenStream {
let mut lifetimes = BTreeSet::new();
for ty in iter {
copy_lifetime_ident(&mut lifetimes, &ty);
}
generics_to_tokens(lifetimes.iter())
}
/// Generates a `TokenStream` of lifetime identifiers `<'lifetime>`.
pub fn generics_to_tokens<'a, I: Iterator<Item = &'a Lifetime>>(lifetimes: I) -> TokenStream {
let lifetimes = lifetimes.collect::<Vec<_>>();