rust-lang/rust-clippy
View on GitHubAdd utils helper for filtering out type/lifetime parameters on generics
Open
#3787 opened on Feb 19, 2019
C-enhancementgood first issue
Description
See https://github.com/rust-lang/rust-clippy/pull/3786/files , we have a lot of code that does something like params.args.iter().filter_map(|arg| match arg { GenericArg::Lifetime(lt) => Some(lt), _ => None }
We should probably have a helper function that returns an iterator for these, placed in utils. Probably something like:
fn types_of_generics(generics: &Generics) -> impl Iterator<Type> {...}
fn lifetimes_of_generics(generics: &Generics) -> impl Iterator<Lifetime> {...}