rust-lang/rust-clippy
GitHub で見るAdd utils helper for filtering out type/lifetime parameters on generics
Open
#3,787 opened on 2019年2月19日
C-enhancementgood first issue
説明
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> {...}